From c9de06e76d12423da2e88c3d46ff75501672a2d7 Mon Sep 17 00:00:00 2001 From: TermiNexus Date: Thu, 13 Aug 2026 03:05:41 +0800 Subject: [PATCH] =?UTF-8?q?fix(stubmerger):=20=E4=BE=9D=E8=B5=96=20stub/te?= =?UTF-8?q?xt=20=E4=B8=BA=E7=A9=BA=E8=AF=AF=E6=9D=80=E6=81=A2=E5=A4=8D?= =?UTF-8?q?=E9=9D=99=E9=BB=98=E8=B7=B3=E8=BF=87?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit stdio.vp 等纯声明模块(全 pass)text.ll 为空是合法形态,stub.ll 为空同理(纯常量/纯导入模块)。fail-fast 改造对"文件存在但为空" 加了错误上报导致误杀,恢复静默跳过;文件缺失分支保留 fail-fast。 --- App/lib/core/StubMerger.vp | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) diff --git a/App/lib/core/StubMerger.vp b/App/lib/core/StubMerger.vp index 41a1c9a..f9c7439 100644 --- a/App/lib/core/StubMerger.vp +++ b/App/lib/core/StubMerger.vp @@ -968,11 +968,8 @@ def _LoadAndAppendStub(temp_dir: str, td_len: t.CSizeT, dep_sha1: str, df_ls.close() stdlib.free(dep_path) if dep_br_ls <= 0: - if LookupSha1RelPath(dep_sha1) is not None: - fb_ls2: str = VLogger.fmt_buf() - if fb_ls2 is not None: - viperlib.snprintf(fb_ls2, 1024, "依赖 stub 为空: %s", dep_sha1) - VLogger.error(fb_ls2, "StubMerger") + # 依赖 stub 为空:纯声明/纯常量模块(如 stdio.vp 全 pass、CDefine 模块) + # 无可声明符号,stub.ll 为空属合法形态,静默跳过 return out_pos if dep_br_ls < STUB_READ_BUF_SIZE: dep_buf[dep_br_ls] = '\0' @@ -1138,11 +1135,8 @@ def _LoadAndAppendTextDeclares(temp_dir: str, td_len: t.CSizeT, dep_sha1: str, tf_lt.close() stdlib.free(text_path) if text_br <= 0: - if LookupSha1RelPath(dep_sha1) is not None: - fb_lt2: str = VLogger.fmt_buf() - if fb_lt2 is not None: - viperlib.snprintf(fb_lt2, 1024, "依赖 text 为空: %s", dep_sha1) - VLogger.error(fb_lt2, "StubMerger") + # 依赖 text 为空:纯 stub 模块(如 stdio.vp 全 pass 声明)无函数体, + # text.ll 为空属合法形态,无可提取 declare,静默跳过 return out_pos if text_br < STUB_READ_BUF_SIZE: dep_buf[text_br] = '\0'