From 68cd5f2f90e0f8c61dda80f1c15b96652c49b92d Mon Sep 17 00:00:00 2001 From: TermiNexus Date: Sun, 4 Oct 2026 20:15:37 +0800 Subject: [PATCH] =?UTF-8?q?fix(tpv):=20=5F=5Fnew=5F=5F=20=E6=88=AA?= =?UTF-8?q?=E6=96=AD=E6=9D=A1=E4=BB=B6=E6=94=BE=E5=AE=BD=E5=88=B0=20nn=5Fp?= =?UTF-8?q?c>=3D1=EF=BC=88=E6=BA=90=E4=BE=A7=20=5F=5Fnew=5F=5F=20=E5=8F=AF?= =?UTF-8?q?=E6=97=A0=E5=8F=82=E6=95=B0=EF=BC=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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:同上(无回归) --- App/lib/core/Gen/Call/CallGenCall.vp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/App/lib/core/Gen/Call/CallGenCall.vp b/App/lib/core/Gen/Call/CallGenCall.vp index e621d63..84c5cc0 100644 --- a/App/lib/core/Gen/Call/CallGenCall.vp +++ b/App/lib/core/Gen/Call/CallGenCall.vp @@ -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...