cpu: allow repeated calls to the same IAT slot in cpu_call_aot #216
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/219"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Imported from R0Y00/Xbox2Windows. Originally posted by Vonsek on 2026-11-21T18:32:48Z.
Change
Allow repeated calls to the same IAT slot in
tools/cpu_call_aot.py(lift_body/translate), matching the existing support for repeated direct calls to one target.Previously,
lift_bodyaccepted repeated direct calls sharing a single target but rejected any secondvia_iatcall withunexpected additional call, even when both call sites targeted the same IAT slot. It now records("import", slot_rva, name)on the first IAT call and reuses the single bounddllimportdeclaration for subsequent calls to the same slot, while rejecting a second call to a different IAT slot or mixed direct/import calls withcall to a second target.Adds:
IMPORT_MIXsupport intests/cpu/repeat_call.asm,tests/cpu/repeat_import.def, andcpu_repeat_import/cpu_repeat_import_liftedtargets inCMakeLists.txt;tests/cpu/repeat_call_check.py;docs/experiments.md.Verification
Tested on Windows 11 x64, VS 2022 Build Tools 17.14 (MSVC 19.44.35230.0, ML64 14.44.35230.0), Windows SDK 10.0.26100, Python 3.12.10 (
pefile==2024.8.26), at commit331eb8c:tools/cpu_call_aot.py, buildingcpu_repeat_import_liftedfails as expected:cpu_aot_repeated_calloutput includesmixed direct/import calls and two distinct IAT slots are rejectedand249 repeated-import input pairs match native execution, guarded trace, RBX and RSI)Evidence and follow-up
All fixtures are assembled from the original MASM source in
tests/cpu/repeat_call.asmlinked against the source-builtcpu_import_provider.dll, and verified differentially against native Windows x64 execution.Multiple distinct import targets in one caller remain intentionally rejected in this single-binding profile.
Checklist
Imported from R0Y00/Xbox2Windows. Originally posted by chatgpt-codex-connector[bot] on 2026-11-21T18:36:13Z.
Codex Review Summary: ✅ Completed
This comment shows the latest Codex review activity on this pull request.
331eb8cℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.
Imported from R0Y00/Xbox2Windows. Originally posted by denn0x on 2026-11-21T18:47:02Z.
For coordination: as requested in review on #223, that branch now carries this PR's commit (rebased onto current
mainas4e820ab, otherwise unchanged) with the distinct-direct-callees change on top. The generatedcpu_repeat_importsource is byte-identical to what this PR's translator produces. The two-slot and mixed-call cases are still rejected, with the messages "call to a second IAT slot" and "mixed import and direct calls". If this PR merges first, #223 reduces to its own commit.AI-assisted (Claude Code).