diff --git a/App/lib/core/Gen/StructGenMixin.vp b/App/lib/core/Gen/StructGenMixin.vp index b50eac6..48076f0 100644 --- a/App/lib/core/Gen/StructGenMixin.vp +++ b/App/lib/core/Gen/StructGenMixin.vp @@ -781,6 +781,8 @@ novirtual class StructGenMixin: return self._NllListMentions(ast.Tuple*(node).elts, al) ch: list[ast.AST*]* = node.children if ch is not None: return self._NllListMentions(ch, al) + # 【临时诊断】认不出的种类被判"提及" + VLogger.info(f"[NLL-MENTION] unknown kind={k} line={node.lineno}", "NLL") return 1 # 认不出的种类:保守算"提及" def _NllAliasSource(self, value: ast.AST*, al: sizet*) -> int: @@ -843,8 +845,12 @@ novirtual class StructGenMixin: if a is None or a.kind() != ast.ASTKind.Name: continue an: ast.Name* = ast.Name*(a) if an.id is None or self._NllInSet(al, an.id) == 0: continue - if mask < 0: return 1 - if ((mask >> idx) & 1) != 0: return 1 + if mask < 0: + VLogger.info(f"[NLL-UNSAFE] arg-mask-unknown line={node.lineno}", "NLL") + return 1 + if ((mask >> idx) & 1) != 0: + VLogger.info(f"[NLL-UNSAFE] arg-escapes bit={idx} line={node.lineno}", "NLL") + return 1 return 0 if k == ast.ASTKind.New: # 构造实参里的调用同样要按不安全位置检查 @@ -866,6 +872,8 @@ novirtual class StructGenMixin: return self._NllExprUnsafe(ie.orelse, al) ch: list[ast.AST*]* = node.children if ch is not None: return self._NllListUnsafe(ch, al) + # 【临时诊断】认不出的表达式种类 + VLogger.info(f"[NLL-UNSAFE] unknown-expr kind={k} line={node.lineno}", "NLL") return 1 # 认不出的表达式种类:保守按"不安全"处理 def _NllStmts(self, stmts: list[ast.AST*]*, al: sizet*, def_node: ast.AST*, depth: int) -> int: @@ -881,6 +889,8 @@ novirtual class StructGenMixin: i += 1 if st is None: continue k: int = st.kind() + # 【临时诊断:定位 NLL 拒绝点,定位后删除】 + VLogger.info(f"[NLL-ST] line={st.lineno} kind={k}", "NLL") if k == ast.ASTKind.Return: if self._NllMentions(ast.Return*(st).value, al) != 0: return 0 elif k == ast.ASTKind.Assign: