mirror of
https://github.com/Ed94/Odin.git
synced 2026-08-05 23:28:48 +00:00
Correct check_expr_is_stack_variable
This commit is contained in:
+2
-1
@@ -1397,6 +1397,7 @@ bool check_stmt_internal_builtin_proc_id(Ast *expr, BuiltinProcId *id_) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
bool check_expr_is_stack_variable(Ast *expr) {
|
bool check_expr_is_stack_variable(Ast *expr) {
|
||||||
|
expr = unparen_expr(expr);
|
||||||
Entity *e = entity_of_node(expr);
|
Entity *e = entity_of_node(expr);
|
||||||
if (e && e->kind == Entity_Variable) {
|
if (e && e->kind == Entity_Variable) {
|
||||||
if (e->flags & EntityFlag_Static) {
|
if (e->flags & EntityFlag_Static) {
|
||||||
@@ -1404,7 +1405,7 @@ bool check_expr_is_stack_variable(Ast *expr) {
|
|||||||
} else if (e->Variable.thread_local_model.len != 0) {
|
} else if (e->Variable.thread_local_model.len != 0) {
|
||||||
// okay
|
// okay
|
||||||
} else if (e->scope) {
|
} else if (e->scope) {
|
||||||
if ((e->scope->flags & (ScopeFlag_Global|ScopeFlag_File)) == 0) {
|
if ((e->scope->flags & (ScopeFlag_Global|ScopeFlag_File|ScopeFlag_Type)) == 0) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user