From d8648176e95d8fe0bd48bfdbb2216356de6a362b Mon Sep 17 00:00:00 2001 From: TermiNexus Date: Fri, 16 Oct 2026 15:26:17 +0800 Subject: [PATCH] =?UTF-8?q?feat(asm):=20op=3D/clobber=3D=20=E6=94=AF?= =?UTF-8?q?=E6=8C=81=E8=A3=B8=E6=9E=9A=E4=B8=BE=E5=90=8D(CLOBBER=5FMEMORY)?= =?UTF-8?q?=20-=20=E7=AD=89=E4=BB=B7=20ASM=5FDESCR.XXX?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- App/lib/core/Gen/Call/CallGenCBuiltin.vp | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/App/lib/core/Gen/Call/CallGenCBuiltin.vp b/App/lib/core/Gen/Call/CallGenCBuiltin.vp index c41c144..04476ad 100644 --- a/App/lib/core/Gen/Call/CallGenCBuiltin.vp +++ b/App/lib/core/Gen/Call/CallGenCBuiltin.vp @@ -670,6 +670,16 @@ novirtual class CallGenCBuiltin(CallGenBase.CallGenBase): if mod_nm2.id is not None and string.strcmp(mod_nm2.id, "ASM_DESCR") == 0: return self._resolve_register(at.attr) return "" + # 裸枚举名(不带 ASM_DESCR. / t. 前缀):`op=[CLOBBER_MEMORY, CLOBBER_RAX]`。 + # 只有确实解析成 ASM_DESCR 成员时才接受(_resolve_register 对未知名给不出非空串), + # 否则返回空串交由调用方按"未知约束"处理,避免把普通变量名误当约束串。 + if k == ast.ASTKind.Name: + nm_b: ast.Name* = ast.Name*(node) + if nm_b.id is not None: + rs_b: str = self._resolve_register(nm_b.id) + if rs_b is not None and rs_b[0] != '\0': return rs_b + return "" + # Constant: string constant if k == ast.ASTKind.Constant: cn: ast.Constant* = ast.Constant*(node)