fix(gen): 变量表 Freed 不再逐个字段写,统一依赖 init_vars 的整块清零
崩点已定位在普通函数形参注册段(auto_addr 之后、_SlifeReset 之前)。add_var 里对刚加过字段的 VarEntry 末端逐个写 entry.Freed 疑似越界/踩偏移;init_vars 本就 memset 整块,去掉冗余写入。
This commit is contained in:
1 parent
9b97470c09
commit
a2e1c651fc
1 file changed
+2
-2
@@ -305,8 +305,8 @@ novirtual class VarGenMixin:
|
||||
entry.IsConst = 0
|
||||
# 生命期标签显式初始化:未登记 = LIFE_UNKNOWN(保守放行)。
|
||||
entry.Life = GenTypes.LIFE_UNKNOWN
|
||||
# P2 willFree:新变量未失效。显式清零,避免复用槽位残留上一变量的失效态。
|
||||
entry.Freed = 0
|
||||
# P2 willFree 的 entry.Freed **不在这里写**:init_vars 已对整块 memset 清零(见 init_vars),
|
||||
# 逐个字段写末端偏移在"结构体刚加字段"时容易踩到;统一依赖整块清零。
|
||||
# [S3 dual write] Value-type Spec (alloca.Ty is Ptr(value type), so take its pointee)
|
||||
entry.Spec = self._spec_of_var_alloca(alloca)
|
||||
return 0
|
||||
|
||||
Reference in new issue
Block a user