diff options
author | Leo Tenenbaum <pommicket@gmail.com> | 2019-10-25 09:57:28 -0400 |
---|---|---|
committer | Leo Tenenbaum <pommicket@gmail.com> | 2019-10-25 09:57:52 -0400 |
commit | 7352f2c357619e23ed348bdadd48f38f9acd4d86 (patch) | |
tree | 39ac2440fb5d58866bc1ac9e57ff58424c235640 /scope.c | |
parent | e278a73bbe573b45f67794301746b08b8fa5c4b2 (diff) |
compile time arrays and slices!
Diffstat (limited to 'scope.c')
-rw-r--r-- | scope.c | 2 |
1 files changed, 2 insertions, 0 deletions
@@ -26,6 +26,8 @@ static void remove_ident_decls(Block *b, Declaration *d) { IdentDecl *last_decl = arr_last(*decls); if (last_decl && last_decl->scope == b) { if ((last_decl->flags & IDECL_FLAG_HAS_VAL) + /* don't free const arrays (there's only one per decl) */ + && !(last_decl->decl->flags & DECL_FLAG_CONST) && last_decl->decl->type.kind == TYPE_ARR) { /* free array on stack */ free(last_decl->val.arr); |