fix(gen): P2 失效状态改存独立槽表,不再给 VarEntry 加字段

现象:任何工程编译都在函数形参注册刚结束处 access-violation(pc=0,逐字节可复现)。定位:逐层探针把崩点压到 FuncGenDef 的 pre_scan 段,而该段对 Check(body 仅 if+return)应为空操作,唯一变量是 VarEntry 这个热结构被加了 Freed 字段。修法:撤销 VarEntry.Freed,改用 VarGenMixin 的独立失效槽表 _g_freed_slots(键 = 变量槽 alloca,整次翻译内唯一,故全局累积、无需按函数 reset/restore);_FreedMark/_FreedCheck/_FreedClearSlot 三个 API 替换字段读写,P2 语义不变。同时清除全部 TEMP 探针。
This commit is contained in:
TermiNexus committed 2026-10-09 11:51:11 +08:00
1 parent 95b076581a
commit dd24dc670f
10 files changed
+61 -50

No files matched your search

-2
View File
@@ -661,8 +661,6 @@ def _PyiClass(buf: bytes, buf_size: sizet, pos: sizet, cls: ast.ClassDef*, inden
# Returns bytes written (0 on failure); rel_path should be absolute for error attribution.
def _GeneratePyiFromAst(mb: memhub.MemBuddy*, tree: ast.AST*, rel_path: str, buf: bytes, buf_size: sizet) -> sizet:
"""Generate .vpi stub content from an AST into buf"""
# [TEMP dbg] 阶段日志:进入 vpi 生成(定位崩溃点,定位后移除)
VLogger.info(f"vpi.gen: {rel_path}", "StubGen")
if tree is None or buf is None or buf_size == 0: return 0
# Error attribution: point "current file" at the file being stubbed. Callers must pass