diff options
| author | gingerBill <bill@gingerbill.org> | 2021-08-18 20:32:54 +0100 |
|---|---|---|
| committer | gingerBill <bill@gingerbill.org> | 2021-08-18 20:32:54 +0100 |
| commit | 3c443babb204feeb0c7a3ed8530a19c80846e71e (patch) | |
| tree | 03f17a3083dec8b5bdf49c93242755758081fc17 /src/llvm_backend_stmt.cpp | |
| parent | 326e5cd04682ea1b6940cc03ea293840538462b7 (diff) | |
Extra sanity check around `static`
Diffstat (limited to 'src/llvm_backend_stmt.cpp')
| -rw-r--r-- | src/llvm_backend_stmt.cpp | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/src/llvm_backend_stmt.cpp b/src/llvm_backend_stmt.cpp index a220995a3..7c537853c 100644 --- a/src/llvm_backend_stmt.cpp +++ b/src/llvm_backend_stmt.cpp @@ -2083,10 +2083,17 @@ void lb_build_stmt(lbProcedure *p, Ast *node) { bool is_static = false; if (vd->names.count > 0) { - Entity *e = entity_of_node(vd->names[0]); - if (e->flags & EntityFlag_Static) { - // NOTE(bill): If one of the entities is static, they all are - is_static = true; + for_array(i, vd->names) { + Ast *name = vd->names[i]; + if (!is_blank_ident(name)) { + Entity *e = entity_of_node(name); + GB_ASSERT(e != nullptr); + if (e->flags & EntityFlag_Static) { + // NOTE(bill): If one of the entities is static, they all are + is_static = true; + break; + } + } } } |