From 08173d7f88f8551caca81594ed8af79d82d3f71f Mon Sep 17 00:00:00 2001 From: zinc Date: Thu, 15 Oct 2026 18:25:36 +0330 Subject: constant expressions: c precedence and / % ^ (b.1.3); local const usable in constant expressions (b.1.7, b.2.16); zc0 matches --- src/compiler/base.zc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/compiler/base.zc') diff --git a/src/compiler/base.zc b/src/compiler/base.zc index a209f2b..3135b39 100644 --- a/src/compiler/base.zc +++ b/src/compiler/base.zc @@ -400,7 +400,7 @@ int nerr, panic; const int LASG = 0x1000, LREAD = 0x2000, LDECL = 0x4000, LCONST = 0x8000, LCNT1 = 0x100000000000000; const int LWASREAD = 0x10000; // an earlier value was read: a fresh value assigned over it clears LREAD, so its drop can still be set (6.15.1) const int NEWTYPED = 0x800000; -word[NL] lpos_initial; word lpos = lpos_initial; word[NL] lreadpos_initial; word lreadpos = lreadpos_initial; word[NL] lnsz_initial; word lnsz = lnsz_initial; word[NL] lleaf_initial; word lleaf = lleaf_initial; word[NL] lrsoff_initial; word lrsoff = lrsoff_initial; word[NL] lrskind_initial; word lrskind = lrskind_initial; int newsz, newleaf, nomagic, callpos; +word[NL] lpos_initial; word lpos = lpos_initial; word[NL] lreadpos_initial; word lreadpos = lreadpos_initial; word[NL] lnsz_initial; word lnsz = lnsz_initial; word[NL] lleaf_initial; word lleaf = lleaf_initial; word[NL] lkval_initial; word lkval = lkval_initial; word[NL] lrsoff_initial; word lrsoff = lrsoff_initial; word[NL] lrskind_initial; word lrskind = lrskind_initial; int newsz, newleaf, nomagic, callpos; word[NL] lptr_initial; word lptr = lptr_initial; // annotate mode: the local was indexed or dereferenced, so it holds an address // storage facts are shared by aliases. they describe one allocation, not a // variable slot: [length, lifetime, kind, allocation place, end place, owner]. @@ -772,6 +772,7 @@ int reserve_locals(int need) { lreadpos = chk_resize(lreadpos, nloc, cap); lnsz = chk_resize(lnsz, nloc, cap); lleaf = chk_resize(lleaf, nloc, cap); + lkval = chk_resize(lkval, nloc, cap); lrsoff = chk_resize(lrsoff, nloc, cap); lrskind = chk_resize(lrskind, nloc, cap); lptr = chk_resize(lptr, nloc, cap); -- cgit v1.2.3