fix(tpv): __new__ 截断条件放宽到 nn_pc>=1(源侧 __new__ 可无参数)

OopInheritTest 报:
  error: 'llvm.call' op incorrect number of operands (4) for callee (expecting: 1)
      %16 = llvm.call @"...Vec3.__new__(%0, %5, %10, %15) : (!llvm.ptr, f64, f64, f64) -> !llvm.ptr

源码 `def __new__() -> 'Vec3' | CPtr:` 无参数(TransPyV 只注入 self),
__init__(self, x, y, z) 才收 x/y/z。上一提交的截断条件写成 nn_pc > 1,
nn_pc == 1 时被跳过 ⇒ 仍多传 3 个。放宽为 nn_pc >= 1(裁到只传 self)。

验证(均已跑通):
- OopInheritTest:PhaseB 编译完成 → PhaseC 产出 OopInheritTest.exe → 完成
- SlotsBugTest:同上(无回归)
This commit is contained in:
TermiNexus committed 2026-10-04 20:15:37 +08:00
1 parent 58cfe2346e
commit 68cd5f2f90
1 file changed
+3 -1
+3 -1
View File
@@ -398,7 +398,9 @@ novirtual class CallGenCall(CallGenBase.CallGenBase):
while nn_pn is not None:
nn_pc += 1
nn_pn = mlirlite.param_get_next(nn_pn)
if nn_pc > 1 and extra_count > nn_pc - 1:
# nn_pc == 1(只有注入的 self,如 `def __new__() -> 'Vec3' | CPtr`)
# 同样要裁:extra_count 归 0,只传 self。
if nn_pc >= 1 and extra_count > nn_pc - 1:
extra_count = nn_pc - 1
# 构建参数链表: self_ptr → extra_args...