fix(gen): 修 REnum match case 静默丢弃与 CDefine 负 64 位常量截断,补 void 注解放行、移植类型定义前移
- MatchGenMixin: 2a 路径查变体 tag 改用裸类名(注解书写形态带模块前缀,与变体表裸名注册口径不一致致 tag=-1、case 被静默丢弃、match 全走 default),并在 build_switch 前硬校验 应提交 case 数==sw_count,不再静默丢 - ExprGenCdef: _const_int_for_cdefine 补 value < -2147483648 下限判据,修正 (0xA5A5A5A5<<32)|0xA5A5A5A5 等负 64 位模式被物化为 i32(写入 inttoptr 零扩展 vs 比较 sext 不一致,致 MemBuddy canary 假阳性 rc=6) - FuncGenDef/ClassGenVTable: 掉尾检查新增注解级 void 判据(t.CVoid/裸名 CVoid/None),不再因 REnum match 退化误判 void 函数缺 return - StubMergerBuild: 移植 TPC 的 类型定义前移 遍,满足 llc 对 by-value 具名类型需先定义的要求(invalid type for function argument) - main.vp/Phase1Main.vp/project.vpj: 新增 --detection-deep 深诊断开关与 canary 哨兵、ASan 静态库声明
This commit is contained in:
1 parent
60100fa6af
commit
31df298341
8 files changed
+345
-6
No files matched your search
@@ -1012,6 +1012,23 @@ class ClassGenVTable(ClassGenBase.ClassGenBase):
|
||||
_is_void = 1
|
||||
case _:
|
||||
pass
|
||||
# 追加91:返回注解层面的"无返回值"判据(与模块级函数
|
||||
# FuncGenDef.vp「_is_void 双保险」同款、同语义,追加89 的
|
||||
# 方法/函数同步约定)。void 方法无需显式 return,掉出末尾合法;
|
||||
# 报文里的"(返回类型 void)"来自 TypePrint 的 `case _` 兜底亦可
|
||||
# 打印 void,不能当作已识别依据,故补注解判据。
|
||||
# ① t.CVoid / ② 裸名 CVoid:经既有判据
|
||||
# TypeGenResolve._is_cvoid_marker(TypeGenResolve.vp:1484)
|
||||
# ③ -> None(CONST_NONE):解析即 Void(TypeGenResolve.vp:1996-1999)
|
||||
if _is_void == 0 and fd.returns is not None:
|
||||
if self.Gen.TypeGenResolve._is_cvoid_marker(
|
||||
fd.returns, imported_modules) != 0:
|
||||
_is_void = 1
|
||||
elif fd.returns.kind() == ast.ASTKind.Constant:
|
||||
ret_none_cn_m: ast.Constant | t.CPtr = (
|
||||
ast.Constant | t.CPtr)(fd.returns)
|
||||
if ret_none_cn_m.const_kind == ast.CONST_NONE:
|
||||
_is_void = 1
|
||||
if _is_void != 0:
|
||||
llvmlite.build_ret_void(func_builder)
|
||||
elif last_is_ctrl != 0 and trans._ctrl_merge_reachable == 0:
|
||||
|
||||
Reference in new issue
Block a user