From b6d6d5ac6bec594df898c1ed94692c422c5e2360 Mon Sep 17 00:00:00 2001 From: TermiNexus Date: Sun, 18 Oct 2026 20:56:21 +0800 Subject: [PATCH] =?UTF-8?q?fix(struct):=20=E4=BF=AE=E5=A4=8D=20=5FUndefine?= =?UTF-8?q?d=20=E6=A3=80=E6=9F=A5=E4=B8=AD=E7=9A=84=E6=9C=AA=E5=AE=9A?= =?UTF-8?q?=E4=B9=89=E5=8F=98=E9=87=8F=20constant?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 列表初始化器中应检查元素 c.constant,原代码引用裸名 constant 导致 NameError。 --- lib/core/LLVMCG/StructGen.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/core/LLVMCG/StructGen.py b/lib/core/LLVMCG/StructGen.py index 57281e3..0b04392 100644 --- a/lib/core/LLVMCG/StructGen.py +++ b/lib/core/LLVMCG/StructGen.py @@ -942,7 +942,7 @@ class StructGenMixin: needs_fix = True elif isinstance(gv.initializer, ir.Constant): if isinstance(gv.initializer.constant, list): - if any(hasattr(c, 'constant') and isinstance(constant, _Undefined) for c in gv.initializer.constant): + if any(hasattr(c, 'constant') and isinstance(c.constant, _Undefined) for c in gv.initializer.constant): needs_fix = True if not needs_fix: continue