aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/ir.cpp7
-rw-r--r--src/llvm_backend.cpp7
2 files changed, 14 insertions, 0 deletions
diff --git a/src/ir.cpp b/src/ir.cpp
index ee463296a..96595c38d 100644
--- a/src/ir.cpp
+++ b/src/ir.cpp
@@ -7765,6 +7765,13 @@ irValue *ir_build_call_expr(irProcedure *proc, Ast *expr) {
}
}
+ Entity *proc_entity = entity_of_node(proc_expr);
+ if (proc_entity != nullptr) {
+ if (proc_entity->flags & EntityFlag_Disabled) {
+ return nullptr;
+ }
+ }
+
if (value == nullptr) {
value = ir_build_expr(proc, proc_expr);
}
diff --git a/src/llvm_backend.cpp b/src/llvm_backend.cpp
index 94832c4cd..672b84fb2 100644
--- a/src/llvm_backend.cpp
+++ b/src/llvm_backend.cpp
@@ -9198,6 +9198,13 @@ lbValue lb_build_call_expr(lbProcedure *p, Ast *expr) {
}
}
+ Entity *proc_entity = entity_of_node(proc_expr);
+ if (proc_entity != nullptr) {
+ if (proc_entity->flags & EntityFlag_Disabled) {
+ return {};
+ }
+ }
+
if (value.value == nullptr) {
value = lb_build_expr(p, proc_expr);
}