aboutsummaryrefslogtreecommitdiff
path: root/src/check_stmt.cpp
diff options
context:
space:
mode:
authorgingerBill <bill@gingerbill.org>2022-08-24 16:03:04 +0100
committergingerBill <bill@gingerbill.org>2022-08-24 16:03:04 +0100
commitaf1b3b6368ffe690ba7f395920fd658b575fa042 (patch)
tree843c2091d33f7092b3169df65e69e0a37ada6d3b /src/check_stmt.cpp
parentd56789e5a77e597ec09d7ffed46ba65543d25750 (diff)
Correct `check_expr_is_stack_variable`
Diffstat (limited to 'src/check_stmt.cpp')
-rw-r--r--src/check_stmt.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/check_stmt.cpp b/src/check_stmt.cpp
index 5673206f3..133ca581f 100644
--- a/src/check_stmt.cpp
+++ b/src/check_stmt.cpp
@@ -1397,6 +1397,7 @@ bool check_stmt_internal_builtin_proc_id(Ast *expr, BuiltinProcId *id_) {
}
bool check_expr_is_stack_variable(Ast *expr) {
+ expr = unparen_expr(expr);
Entity *e = entity_of_node(expr);
if (e && e->kind == Entity_Variable) {
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) {
// okay
} 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;
}
}