fix(stubmerger): 依赖 stub/text 为空误杀恢复静默跳过
stdio.vp 等纯声明模块(全 pass)text.ll 为空是合法形态,stub.ll 为空同理(纯常量/纯导入模块)。fail-fast 改造对"文件存在但为空" 加了错误上报导致误杀,恢复静默跳过;文件缺失分支保留 fail-fast。
This commit is contained in:
1 parent
a56fc6badc
commit
c9de06e76d
1 file changed
+4
-10
@@ -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'
|
||||
|
||||
Reference in new issue
Block a user