From 1a3ef521b3eea8a0183fdf473eeaa661088f3411 Mon Sep 17 00:00:00 2001 From: TermiNexus Date: Fri, 9 Oct 2026 12:43:59 +0800 Subject: [PATCH] =?UTF-8?q?chore(dbg):=20P4=20=E8=BD=AC=E7=A7=BB=E5=88=86?= =?UTF-8?q?=E6=94=AF=E9=80=90=E7=82=B9=E6=8E=A2=E9=92=88=EF=BC=88owned/beg?= =?UTF-8?q?in/ensured/drop.begin/dropped=EF=BC=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 崩点已后移到 CaseOwnershipTransfer 的 q = p(P4 别名转移),逐点定位该分支内具体崩溃位置。TEMP。 --- App/lib/core/Gen/AssignGenMixin.vp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/App/lib/core/Gen/AssignGenMixin.vp b/App/lib/core/Gen/AssignGenMixin.vp index 02dc840..c7a6605 100644 --- a/App/lib/core/Gen/AssignGenMixin.vp +++ b/App/lib/core/Gen/AssignGenMixin.vp @@ -765,12 +765,17 @@ novirtual class AssignGenMixin: # (q 置 1、p 置 0)。此后对 p 重新赋值不会释放对象(p 已不拥有该对象), # 出口只释放 q 一次。不转移的话,`p = None` 会把 q 指向的对象提前释放 → q 悬垂。 if src_slot is not None: + VLogger.info(f"dbg.xfer owned={self.Gen.VarGen._SlifeOwned(src_slot)}", "TR") if self.Gen.VarGen._SlifeOwned(src_slot) != 0: + VLogger.info("dbg.xfer.p4.begin", "TR") tsh: mlirlite.Value* = self.Gen.VarGen._SlifeEnsureOwned(pool, builder, target_slot) + VLogger.info("dbg.xfer.ensured", "TR") if tsh is not None: + VLogger.info("dbg.xfer.drop.begin", "TR") # 覆盖释放 target 原有对象:若它与源是**同一个对象**(自别名 `q = p; q = p`) # 则跳过,否则会把两个槽共持的对象提前释放。 self.Gen.VarGen._SlifeDropOwnedUnlessSame(pool, builder, mod, trans, target_slot, src_slot) + VLogger.info("dbg.xfer.dropped", "TR") self.Gen.VarGen._SlifeNoteStore(pool, builder, tsh, 1) ssh: mlirlite.Value* = self.Gen.VarGen._SlifeShadow(src_slot) if ssh is not None: self.Gen.VarGen._SlifeNoteStore(pool, builder, ssh, 0)