aboutsummaryrefslogtreecommitdiff
path: root/src/compiler/base.zc
diff options
context:
space:
mode:
authorGravatar zinc <zinc@downsta.ir> 2026-10-15 02:35:04 +0330
committerGravatar zinc <zinc@downsta.ir> 2026-10-15 02:40:51 +0330
commit31ae48845492c12f2745c7f4c0cd2ea448e0942a (patch)
treebcd26f483f4774fbcbae9c621050b10b3b53f295 /src/compiler/base.zc
parentgenmap: default genome reservation 0x70000 words (the genome had 197 words le... (diff)
destructors: reassigning an m owner that still holds a value frees the old value first, running its drop (right side first, then the free, then the store), with hint: x: reassigning frees the old value; a new value that is part of the old one is an error; u, d and captured owners keep the leak error; the new value's size, leaf type and drop are recorded like a declaration's; spec 6.8.5, 6.15.2
Diffstat (limited to 'src/compiler/base.zc')
-rw-r--r--src/compiler/base.zc1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/compiler/base.zc b/src/compiler/base.zc
index 99ee10f..a8dc19f 100644
--- a/src/compiler/base.zc
+++ b/src/compiler/base.zc
@@ -391,6 +391,7 @@ int nerr, panic;
// read, declared with let, initialized with a literal; the size of the object
// a new gave it (bits 16 to 39); and how many times it was used (from bit 56)
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] lptr_initial; word lptr = lptr_initial; // annotate mode: the local was indexed or dereferenced, so it holds an address