fix(transpyv): 跨模块链表 Next 字段改用访问器(消除 __inherited_N 占位名 fail-fast)
c 源码违规:llvmlite 的 Value/ParamNode/Function/Param/GlobalVariable/PhiIncoming/ SwitchCase 的 Next 继承自泛型基类 GSListNode[T],而其泛型特化体不在任何 .vpi 中 ⇒ 导入侧 class_members 只有 __inherited_N 占位名;严格属性解析(回退已移除)下 裸写 `x.Next` fail-fast。现场:CallGenCall.vp `cur_fb = cur_fb.Next` 报 "[fast-fail] 属性 Next 在类 ParamNode 中找不到(class_members=[__inherited_0, Ty])"。 按仓库既有约定(_Type.md:链表遍历用 paramnode_get_next/paramnode_set_next; VarGenMixin/TypeSpec/StructGenMixin/VpiReader 等已如此书写)统一改为访问器: value_get_next/value_set_next、paramnode_get_next/paramnode_set_next、 function_get_next、param_get_next、globalvariable_get_next、 phiincoming_set_next、switchcase_set_next 覆盖 24 个文件共 110 处(含 CallGenProp.vp:122 的嵌套读 cur_arg_pc.Next)。 访问器在 includes 侧为定义模块内直通实现(None 守卫 + x.Next),语义等价、零行为 变化。已全量扫描 core\Gen 全 47 文件与 Stub/Phase/core/main:App 侧已无裸继承字段 访问(剩余 .Next 命中全部在注释里)。
This commit is contained in:
1 parent
75ea6fb9b2
commit
13080f646f
24 files changed
+118
-114
No files matched your search
@@ -547,7 +547,7 @@ novirtual class ClassGenEnum(ClassGenBase.ClassGenBase):
|
||||
total += fsize
|
||||
if is_packed == 0 and falign > max_align:
|
||||
max_align = falign
|
||||
cur = cur.Next
|
||||
cur = llvmlite.paramnode_get_next(cur)
|
||||
i += 1
|
||||
# packed 无尾部对齐;非 packed 总大小对齐到最大字段对齐的倍数
|
||||
if is_packed != 0:
|
||||
@@ -595,7 +595,7 @@ novirtual class ClassGenEnum(ClassGenBase.ClassGenBase):
|
||||
fa: int = self._get_type_align(fty)
|
||||
if fa > max_align:
|
||||
max_align = fa
|
||||
cur = cur.Next
|
||||
cur = llvmlite.paramnode_get_next(cur)
|
||||
i += 1
|
||||
return max_align
|
||||
case _:
|
||||
|
||||
Reference in new issue
Block a user