refactor: rawptr[T] -> T*(R14)+ 修 REnum 前向占位未就地填充
R14:rawptr[X] -> X*(56 文件 / 834 行改动);保留 6 处 rawptr[t.CPtr](存纯裸指针的规范例外)。 修复:class X(t.REnum) 的变体字段写成自引用 X* 时,字段解析在变体扫描期经 ensure_forward_class 建了一个 opaque 前向占位;末尾 register_struct 按 Ty 指针去重会再建第二个同名 entry,而 find_struct 取首个(占位,0 字段)→ X.__sizeof__() == 0,报「已注册但大小为 0(字段链表未填充)」。改为注册前若命中同模块前向占位则就地填充(与 ensure_forward_class 文档口径一致)。TPC 无此问题,属 TPV 侧缺口。 验证:自举三重重编 SUCCESS;全量 77/77 顺序回归通过(修复前卡在 LLvmLiteTest)。
This commit is contained in:
1 parent
aeb4e8e54c
commit
cd55a7e214
56 files changed
+834
-822
No files matched your search
@@ -14,7 +14,7 @@ import w32.fileio as fileio
|
||||
# Config - project configuration
|
||||
|
||||
# Global mbuddy pointer
|
||||
_mbuddy: rawptr[memhub.MemManager]
|
||||
_mbuddy: memhub.MemManager*
|
||||
|
||||
# Config values (loaded from project.vpj); default None/0: callers must guard with `is not None` (else garbage pointer crash)
|
||||
SourceDir: str = None
|
||||
@@ -56,7 +56,7 @@ def Load_project_config(path: str) -> int:
|
||||
if _mbuddy is None: return 1
|
||||
|
||||
# Open file
|
||||
f: rawptr[fileio.File] = fileio.File(path, fileio.MODE.R)
|
||||
f: fileio.File* = fileio.File(path, fileio.MODE.R)
|
||||
if f is None: return 1
|
||||
if f.closed: return 1
|
||||
|
||||
|
||||
@@ -48,7 +48,7 @@ def compute_sha1(pool: memhub.MemBuddy*, content: str) -> str:
|
||||
if content is None or pool is None: return None
|
||||
|
||||
# ctx is stack-allocated (alloca); no heap allocation needed
|
||||
ctx: rawptr[hashlib.sha1] = hashlib.sha1()
|
||||
ctx: hashlib.sha1* = hashlib.sha1()
|
||||
if ctx is None: return None
|
||||
|
||||
# Compute the digest
|
||||
@@ -87,7 +87,7 @@ def JoinPath(a: str, b: str) -> str:
|
||||
def read_file_to_buf(path: str, buf_size: sizet) -> bytes:
|
||||
"""Read a whole file into a null-terminated malloc buffer, or None."""
|
||||
if path is None or buf_size <= 0: return None
|
||||
sf: rawptr[fileio.File] = fileio.File(path, fileio.MODE.R)
|
||||
sf: fileio.File* = fileio.File(path, fileio.MODE.R)
|
||||
if sf.closed: return None
|
||||
buf: bytes = stdlib.malloc(buf_size)
|
||||
if buf is None:
|
||||
|
||||
Reference in new issue
Block a user