fix(extern): 从 temp_dir 全量 .vpi 收集 extern
sig_files 键集合不含 include 模块(win32process 等);直接扫描 temp_dir/*.vpi 补全 export_extern_funcs,确保 ReadProcessMemory/StackWalk64 裸名。
This commit is contained in:
1 parent
5a56198937
commit
0903491df3
1 file changed
+7
-1
@@ -2398,7 +2398,13 @@ class Phase2Translator:
|
||||
# 共享集合可能因 sig_files 过滤而缺少 include 模块的 extern 声明;
|
||||
# 这里从本 translator 的 sig_files 合并补全(跨模块 extern 必须裸名)。
|
||||
_combined_extern: dict[str, str] = dict(self._shared_export_extern_funcs)
|
||||
for _sha1_key, _sig_path in self.sig_files.items():
|
||||
_sig_paths: list[tuple[str, str]] = list(self.sig_files.items())
|
||||
_temp_vpi_dir: str = getattr(self, 'temp_dir', '') or ''
|
||||
if _temp_vpi_dir and os.path.isdir(_temp_vpi_dir):
|
||||
for _fn in os.listdir(_temp_vpi_dir):
|
||||
if _fn.endswith('.vpi'):
|
||||
_sig_paths.append((_fn[:-4], os.path.join(_temp_vpi_dir, _fn)))
|
||||
for _sha1_key, _sig_path in _sig_paths:
|
||||
try:
|
||||
_, _sig_tree = parse_python_file(_sig_path)
|
||||
if _sig_tree is None:
|
||||
|
||||
Reference in new issue
Block a user