chore(dbg): 加 NLL 判定链临时诊断([NLL-DBG]),定位后删除
This commit is contained in:
1 parent
337be883d3
commit
e82e2ac768
1 file changed
+7
-1
@@ -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=不是"""
|
||||
|
||||
Reference in new issue
Block a user