From 39aebc03d7842182df7be086de6f31493913b2a6 Mon Sep 17 00:00:00 2001 From: TermiNexus Date: Mon, 19 Oct 2026 18:25:17 +0800 Subject: [PATCH] =?UTF-8?q?fix(traceback):=20main=20=E6=B3=A8=E5=85=A5?= =?UTF-8?q?=E6=94=AF=E6=8C=81=E4=BB=8E=20ModuleSha1Map=20=E8=A7=A3?= =?UTF-8?q?=E6=9E=90=20Install?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit TracebackInstallSymbol 未设置时,用 Gen.ModuleSha1Map['traceback'] 拼出 {sha1}.Install,确保 main 入口注入生效。 --- lib/core/Handles/HandlesFunctions.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lib/core/Handles/HandlesFunctions.py b/lib/core/Handles/HandlesFunctions.py index fd4bcb2..5251e04 100644 --- a/lib/core/Handles/HandlesFunctions.py +++ b/lib/core/Handles/HandlesFunctions.py @@ -2056,6 +2056,10 @@ class FunctionHandle(BaseHandle): Gen._create_doc_global(doc_symbol, None) if Node.name == 'main': _tb_install: str | None = getattr(self.Trans, 'TracebackInstallSymbol', None) + if not _tb_install: + _tb_sha1 = getattr(Gen, 'ModuleSha1Map', {}).get('traceback') + if _tb_sha1: + _tb_install = f'{_tb_sha1}.Install' if _tb_install: _install_fn = Gen._CreateOrReuseFuncDecl( _tb_install, ir.FunctionType(ir.IntType(32), []))