From feb29fa7a3f6f895bd9ffc9868f30ee27f829960 Mon Sep 17 00:00:00 2001 From: TermiNexus Date: Sat, 3 Oct 2026 14:18:14 +0800 Subject: [PATCH] =?UTF-8?q?fix(generic-func):=20=E5=8F=91=E5=B0=84?= =?UTF-8?q?=E7=89=B9=E5=8C=96=E8=B0=83=E7=94=A8=E6=94=B9=E4=BC=A0=E7=AC=A6?= =?UTF-8?q?=E5=8F=B7=E5=90=8D=EF=BC=88callee:=20str=EF=BC=89=E8=80=8C?= =?UTF-8?q?=E9=9D=9E=20Function*=EF=BC=8C=E4=BF=AE=E5=A4=8D=E7=94=9F?= =?UTF-8?q?=E6=88=90=E7=A9=BA=20@=20=E7=9A=84=E9=9D=9E=E6=B3=95=20IR?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- App/lib/core/Gen/Call/CallGenDispatch.vp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/App/lib/core/Gen/Call/CallGenDispatch.vp b/App/lib/core/Gen/Call/CallGenDispatch.vp index b2e09fb..d614aa1 100644 --- a/App/lib/core/Gen/Call/CallGenDispatch.vp +++ b/App/lib/core/Gen/Call/CallGenDispatch.vp @@ -244,7 +244,10 @@ novirtual class CallGenDispatch(CallGenBase.CallGenBase): if fp is not None: fp = llvmlite.param_get_next(fp) ai += 1 - return llvmlite.build_call(builder, func, head, int(can), ret_ty, 0) + # build_call 的第二参是**被调符号名字符串**(callee: str),不是 Function*—— + # 传 Function* 会被当成字符串读到结构体首字段(Next 指针),发射出 + # `call i32 @(i32 7)`(空名字)这种非法 IR。这里用查找时同一符号名。 + return llvmlite.build_call(builder, spec_name, head, int(can), ret_ty, 0) def _tc_h1_super_ctraits(self, pool: memhub.MemBuddy*, builder: llvmlite.IRBuilder*,