Fix @(disable=...)

This commit is contained in:
gingerBill
2022-05-02 14:10:02 +01:00
parent 2d3f59d9a7
commit 8023c8abc7
+9 -13
View File
@@ -823,12 +823,6 @@ lbValue lb_emit_call(lbProcedure *p, lbValue value, Array<lbValue> const &args,
GB_ASSERT(pt->kind == Type_Proc);
Type *results = pt->Proc.results;
if (p->entity != nullptr) {
if (p->entity->flags & EntityFlag_Disabled) {
return {};
}
}
lbAddr context_ptr = {};
if (pt->Proc.calling_convention == ProcCC_Odin) {
context_ptr = lb_find_or_generate_context_ptr(p);
@@ -2280,6 +2274,15 @@ lbValue lb_build_call_expr_internal(lbProcedure *p, Ast *expr) {
// NOTE(bill): Regular call
lbValue value = {};
Ast *proc_expr = unparen_expr(ce->proc);
Entity *proc_entity = entity_of_node(proc_expr);
if (proc_entity != nullptr) {
if (proc_entity->flags & EntityFlag_Disabled) {
GB_ASSERT(tv.type == nullptr);
return {};
}
}
if (proc_expr->tav.mode == Addressing_Constant) {
ExactValue v = proc_expr->tav.value;
switch (v.kind) {
@@ -2306,13 +2309,6 @@ lbValue lb_build_call_expr_internal(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);
}