Files
TransPyC/Test/NoVTableCrossMixinTest/project.json
T
TermiNexus bd5d2467ab fix(exprcall): NoVTable 跨 Mixin self. 调用按定义类解析 + this 前移
缺陷(TPV bootstrap 的 undefined symbol: <sha1>.StmtGenDeclMixin.translate_return
同根因):NoVTable 多继承下,BaseB.caller 内 self.helper()(helper 定义在兄弟
Mixin BaseA,经 Combined(BaseA, BaseB) 组合)被 mangle 成 BaseB.helper —— 用
调用者类做前缀,而定义符号是 BaseA.helper -> ld.lld undefined symbol。

修复(HandlesExprCall.py):
1. 调用端 MRO 回退失败后,全局扫描已注册类找方法定义类(兄弟 Mixin 兜底);
2. _adjust_this_for_inherited_method 支持"调用类不含定义类字段"场景:
   this 按组合布局前移 sizeof(定义类 struct)(BaseB* -> BaseA*)。

新增 Test/NoVTableCrossMixinTest 回归(caller()==42 通过),TestsOverview 记录。
2026-08-20 10:23:47 +08:00

30 lines
895 B
JSON

{
"$schema": "https://raw.githubusercontent.com/TermiNexus/TransPyC/main/schemas/project-schema.json",
"name": "NoVTableCrossMixinTest",
"version": "1.0.0",
"source_dir": "./App",
"build_dir": "./.tpv_build",
"compiler": {
"cmd": "llc",
"flags": ["-filetype=obj", "-relocation-model=pic"]
},
"linker": {
"cmd": "clang++",
"flags": ["-lmsvcrt", "-lucrt", "-lpthread", "-lmingwex", "-lkernel32", "-Wl,--allow-multiple-definition"],
"output": "NoVTableCrossMixinTest.exe"
},
"includes": [
"../../includes"
],
"target": {
"triple": "x86_64-pc-windows-gnu",
"datalayout": "e-m:w-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
},
"options": {
"slice_level": 3,
"sha1_slice_level": 1,
"target": "llvm",
"strict_mode": true
}
}