mirror of
https://github.com/Ed94/Odin.git
synced 2026-08-07 08:08:50 +00:00
Disallow global use of target specific procedure calls
This commit is contained in:
+4
-1
@@ -7904,7 +7904,9 @@ gb_internal ExprKind check_call_expr(CheckerContext *c, Operand *operand, Ast *c
|
|||||||
|
|
||||||
// NOTE: Due to restrictions in LLVM you can not inline calls with a superset of features.
|
// NOTE: Due to restrictions in LLVM you can not inline calls with a superset of features.
|
||||||
if (is_call_inlined) {
|
if (is_call_inlined) {
|
||||||
GB_ASSERT(c->curr_proc_decl);
|
if (c->curr_proc_decl == nullptr) {
|
||||||
|
error(call, "Inlined procedure which enables target feature '%.*s' cannot be used at the global/file scope", LIT(invalid));
|
||||||
|
} else {
|
||||||
GB_ASSERT(c->curr_proc_decl->entity);
|
GB_ASSERT(c->curr_proc_decl->entity);
|
||||||
GB_ASSERT(c->curr_proc_decl->entity->type->kind == Type_Proc);
|
GB_ASSERT(c->curr_proc_decl->entity->type->kind == Type_Proc);
|
||||||
String scope_features = c->curr_proc_decl->entity->type->Proc.enable_target_feature;
|
String scope_features = c->curr_proc_decl->entity->type->Proc.enable_target_feature;
|
||||||
@@ -7914,6 +7916,7 @@ gb_internal ExprKind check_call_expr(CheckerContext *c, Operand *operand, Ast *c
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
operand->expr = call;
|
operand->expr = call;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user