Repository navigation
[AUTOMATED] Keep a tested call argument in a function with six parameters - #1889
Merged
mahaloz merged 61 commits intoNov 23, 2026
Merged
Conversation
[AUTOMATED] Preserve the exact decoded call site and executable-section exclusion without adding a discovered procedure.
…traps The datatest harness built every test file's architecture from scratch: it re-decoded the same .sla and re-parsed every .ldefs for each file, which was ~60% of `make test` / `make test-stages` CPU. engine::reuse_specs() (opt-in, called by decomp_test_dbg) makes a process scan each set of on-disk spec roots once, and keep a decoded template of each .sla a thread decodes twice (kuna_slacache, keyed by file contents). Later translators are SleighBase::clone_decoded copies: a fresh space set rebuilt from the .sla space records, every space reference remapped by index, xrefs and context variables rebuilt as a decode does. Single-binary CLI runs never enable it and take the unchanged decode path. Harness output is byte-identical on both corpora. decomp_test_dbg, A/B: datatests 3.3 s -> 1.25 s CPU, stages ~50-58 s -> ~23-28 s CPU; peak RSS 96 -> 232 MB and ~400 -> ~620 MB. Co-Authored-By: Claude Opus 5.5 <[email protected]>
… PowerPC PLT entry
kuna-cli tests that compile printed C and run the result used bare Command::output()/status(), so a child that never exits stalled the whole suite. On macOS 26 Apple clang 17's ASan runtime hangs before main, which made `make rust-test` never finish. - common::process gains a Capped trait (capped_output/capped_status) that kills and reaps a child after 300 s; required_output/optional_output and every run of a natively built or emulated executable go through it. - sanitizer_runs() builds and runs a trivial program with the sanitizer flags once per process under a 30 s cap; the ASan round trips skip a compiler that fails it, the same way they skip a missing compiler. - a_float_handed_on_through_wrappers_to_an_integer_round_trips runs its MAP_FIXED_NOREPLACE harness only on Linux. - a_value_read_by_a_sign_sensitive_op_is_not_re_read_from_a_global runs its x86-64 ELF fixtures only on Linux x86-64 and checks the spelling elsewhere. Co-Authored-By: Claude Opus 5.5 <[email protected]>
macOS answered no resident set, so `--max-fn-memory N` was refused on every Mac. Read `proc_pid_rusage(RUSAGE_INFO_V2)`'s `ri_phys_footprint`: unlike `task_info`'s resident size it drops when libmalloc marks freed pages reusable, which matters because macOS has no `malloc_trim` to hand pages back between functions. One call costs ~0.4 µs and is taken at most every 50 ms per armed drive, and not at all without the flag. Co-Authored-By: Claude Opus 5.5 <[email protected]>
calleereadarg restores a register argument the caller also tests when the callee's body reads that register. It declined whenever the calling function's own entry read its last argument register, taking that as a sign of a variadic register-save prologue. A function with six parameters reads r9 too (clang keeps it with mov %r9d,%ebx), so `if (buf[0]) return ext(buf[0]) + 1;` printed `ext() + 1`. A register-save prologue only stores the registers; the caller now counts as possibly variadic only when its entry reads the last argument register just to store it. Strict correctness fix, no option. New stage test kuna-calleereadarg-sixth; kuna-pointerwalk-memo gains an assertion for the same call (found by the differential checker). No existing assertion pinned the dropped argument. Automated change. Co-Authored-By: Claude Opus 5.5 <[email protected]>
sjkim1127
force-pushed
the
fix/calleereadarg-sixth-param
branch
from
November 22, 2026 20:18
6364887 to
e7a9a57
Compare
Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_013BBaWTdjVzTz11WxPZmJ9b
Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_013BBaWTdjVzTz11WxPZmJ9b
Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_013BBaWTdjVzTz11WxPZmJ9b
Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_013BBaWTdjVzTz11WxPZmJ9b
Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_013BBaWTdjVzTz11WxPZmJ9b
…tride Resolves the stage-corpus file count (main's 861 plus this branch's kuna-aif-slot-edges = 862) and re-synthesizes docs/baseline-stages.json from both sides. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_013BBaWTdjVzTz11WxPZmJ9b
…n export The xrefs section on exports called through their own PLT stub now says that ARM, AArch64, PowerPC32 absolute/BSS-PLT and PowerPC64 ELFv1 stubs are recognized by shape, and which shapes are not joined (Thumb interworking prefixes, --long-plt, PAC entries, PowerPC32 secure-PLT PIC stubs), so a reader knows when to query the stub address instead. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_013BBaWTdjVzTz11WxPZmJ9b
With e500 selected for every SPE-note image, ordinary integer functions lose
arguments: the e500 model drops a 32-bit argument read through mulhwu
(`ud3(u32 a) { return a / 3; }` decompiles as `ud3(void)` with an
uninitialized 64-bit local), and 64-bit integer pairs lose halves. On 414
GCC -O2 PPC32 objects given an SPE note, 23 integer-only functions went from
the DWARF parameter count to too few and 12 from too many to correct.
ppcapu becomes isel|on|off, default isel. isel selects the generic PowerPC32
model plus ISEL for an ISEL, SPE or embedded floating-point requirement or the
embedded ABI flag, so every such image decodes what main decodes plus isel.
on keeps the e500 selection for SPE requirements (the previous PR default and
main's opt-in); off keeps the generic decoder.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_013BBaWTdjVzTz11WxPZmJ9b
…ot a reference to it A name query widened to an export's own PLT stub and slot also picked up every `data` row whose value merely equals the stub's or slot's address: an immediate (`li r9,0x2064`, `mov w0,#0x4b50`) or an AArch64 adrp page base that happens to equal the slot. In a position-independent image such a value is not the export's address. refs_to_class now drops `data` rows to the export-PLT members only; calls, jumps, reads and writes are kept, the x86-64 veneer path is unchanged, and a query by the stub's address still lists the row. Over 348 changed name queries on real AArch64/ARM/PPC shared objects this removes exactly the 14 such rows and nothing else. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_013BBaWTdjVzTz11WxPZmJ9b
Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_013BBaWTdjVzTz11WxPZmJ9b
Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_013BBaWTdjVzTz11WxPZmJ9b
Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_013BBaWTdjVzTz11WxPZmJ9b
Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_013BBaWTdjVzTz11WxPZmJ9b
Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_013BBaWTdjVzTz11WxPZmJ9b
Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_013BBaWTdjVzTz11WxPZmJ9b
Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_013BBaWTdjVzTz11WxPZmJ9b
Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_013BBaWTdjVzTz11WxPZmJ9b
Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_013BBaWTdjVzTz11WxPZmJ9b
Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_013BBaWTdjVzTz11WxPZmJ9b
Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_013BBaWTdjVzTz11WxPZmJ9b
Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_013BBaWTdjVzTz11WxPZmJ9b
Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_013BBaWTdjVzTz11WxPZmJ9b
Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_013BBaWTdjVzTz11WxPZmJ9b
Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_013BBaWTdjVzTz11WxPZmJ9b
Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_013BBaWTdjVzTz11WxPZmJ9b
Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_013BBaWTdjVzTz11WxPZmJ9b
Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_013BBaWTdjVzTz11WxPZmJ9b
Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_013BBaWTdjVzTz11WxPZmJ9b
Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_013BBaWTdjVzTz11WxPZmJ9b
Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_013BBaWTdjVzTz11WxPZmJ9b
Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_013BBaWTdjVzTz11WxPZmJ9b
Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_013BBaWTdjVzTz11WxPZmJ9b
Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_013BBaWTdjVzTz11WxPZmJ9b
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
A function with six or more register parameters drops the argument of a call when it also tests that value. clang -O2 for
if (buf[0]) return ext(buf[0]) + 1;inside a six-parameter function loadsbuf[0]intoedi, tests it, and callsext, which readsedi. kuna prints the call with no argument:With this change:
return sub_401000((unsigned char)v1[0]) + 1;Fix
calleereadargrestores a tested argument when the callee's body reads the register. It skipped every call in a function whose own entry reads the last argument register (r9on SysV x86-64), treating that as a possible variadic register-save prologue.mov %r9d,%ebx) is not variadic on that account.altest and the callee-side checks are unchanged. No option: the old output passed a call fewer arguments than the program does.Tests
tests/stages/kuna-calleereadarg-sixth.xml(the bytes above). Both assertions fail without the fix.tests/stages/kuna-pointerwalk-memo.xmlgains an assertion for itsext(buf[0])call, which had the same bug.🤖 Generated with Claude Code