aboutsummaryrefslogtreecommitdiffhomepage
path: root/c/eval.c
diff options
context:
space:
mode:
authorlemon <lsof@mailbox.org>2025-12-30 10:34:11 +0100
committerlemon <lsof@mailbox.org>2025-12-30 10:37:13 +0100
commite77538515802276d76dfcb28c9b8dc140d5afe02 (patch)
tree48ece54a12bc4a447db386214b29b3e9890925e7 /c/eval.c
parent2b6b6b79beba618ab46c353a59a1c90539340021 (diff)
c: SYM expr should store decl ref as an index, not pointer
Because envdecls (now declsbuf) can be resized and invalidate those pointers. I missed this because the default initialization size of that buffer (and the fact that it would mostly only manifest with function-local expressions) made it not really come up in practice. Silly
Diffstat (limited to 'c/eval.c')
-rw-r--r--c/eval.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/c/eval.c b/c/eval.c
index 746bc64..d227c91 100644
--- a/c/eval.c
+++ b/c/eval.c
@@ -158,7 +158,7 @@ unop(struct expr *ex, enum evalmode mode)
static bool
isglobsym(const struct expr *ex)
{
- return ex->t == ESTRLIT || (ex->t == ESYM && ex->sym && (ex->sym->scls & (SCSTATIC | SCEXTERN)));
+ return ex->t == ESTRLIT || (ex->t == ESYM && ex->ty.t < NTYPETAG && (declsbuf.p[ex->decl].scls & (SCSTATIC | SCEXTERN)));
}
static bool