From e82e2ac768c9d205954916639ad47fe799d949a3 Mon Sep 17 00:00:00 2001 From: TermiNexus Date: Fri, 9 Oct 2026 21:05:31 +0800 Subject: [PATCH] =?UTF-8?q?chore(dbg):=20=E5=8A=A0=20NLL=20=E5=88=A4?= =?UTF-8?q?=E5=AE=9A=E9=93=BE=E4=B8=B4=E6=97=B6=E8=AF=8A=E6=96=AD=EF=BC=88?= =?UTF-8?q?[NLL-DBG]=EF=BC=89=EF=BC=8C=E5=AE=9A=E4=BD=8D=E5=90=8E=E5=88=A0?= =?UTF-8?q?=E9=99=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- App/lib/core/Gen/Call/CallGenCtor.vp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/App/lib/core/Gen/Call/CallGenCtor.vp b/App/lib/core/Gen/Call/CallGenCtor.vp index 5be0152..9bf774f 100644 --- a/App/lib/core/Gen/Call/CallGenCtor.vp +++ b/App/lib/core/Gen/Call/CallGenCtor.vp @@ -327,9 +327,15 @@ novirtual class CallGenCtor(CallGenBase.CallGenBase): if rhs is None or rhs.kind() != ast.ASTKind.New: return 0 nn: ast.New* = ast.New*(rhs) if nn is None: return 0 + # 【临时诊断:定位 §13 NLL 为何不生效,定位后删除】 + curf: int = 0 + if self.Gen.StructGen.NllCurFunc is not None: curf = 1 + VLogger.info(f"[NLL-DBG] var={var_name} src={nn.Source} life={nn.Life} curfunc={curf}", "NLL") if nn.Source != ast.NEW_SRC_HEAP and nn.Source != ast.NEW_SRC_DEFAULT: return 0 if nn.Life != ast.NEW_LIFE_DEFAULT: return 0 - return self.Gen.StructGen.NllFrameConfined(trans, var_name, rhs) + conf: int = self.Gen.StructGen.NllFrameConfined(trans, var_name, rhs) + VLogger.info(f"[NLL-DBG] var={var_name} confined={conf}", "NLL") + return conf def _new_is_owned_heap(self, new_node: ast.New*) -> int: """1=`new` 生成编译器独占释放的堆绑定 / 0=不是"""