Repository navigation
[AUTOMATED] voidret: a returned value its function also indexes with is returned - #1885
Merged
Merged
Conversation
…it alone gcc keeps an argument in rdi across a call to a function it knows does not write it. Inside a loop heritage then joins the incoming rdi with the rdi carried back past the call, AncestorRealistic reads the call's INDIRECT as a kill and marks the trial definitely not used, and the call printed add_pair() while add_pair(S *) was recovered in the same run. passthrough now follows copies, phis and non-creating INDIRECTs back to the function's own incoming register, and check_input_trial_use scores such a trial inactive when the callee's statement has a parameter there. Over gcc -O2 -fno-inline bzip2, gzip, grep, find and libcmark, 37 of 121 calls that passed nothing to a callee with parameters now pass its argument. [AUTOMATED]
gnulib base_len loads through name + len - 1 and returns len, and its callers read rax, yet it printed void: onlyOpUse followed the sum to the LOAD and refused the trial. An addition to another variable makes the value an index, so under forced return scoring that use no longer competes; a load or store through the value plus a constant still refuses it. [AUTOMATED]
…register alone forwarded_own_input followed every non-creating INDIRECT back to the incoming register, but the cspec gives every call an unknown effect on the argument registers it does not list as killed (x86-64 rdi/rsi/rcx/r8/r9, AArch64 x2..x7), so the INDIRECT says nothing about whether the value survived. On AArch64 C code that invented parameters: dash killcmd became killcmd(int, void *, unsigned long a2) forwarding x2 past kill/strerror to sh_warnx, whose va_start save reads x2. Each INDIRECT on the chain must now guard a direct call (not a PLT stub) whose decoded callee body the callee-write probe proves never writes the register. This is only an extra refusal: a refused chain falls back to upstream's definitely-not-used scoring, which is main's behaviour. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_0179iMKNhsvezm24JAGcKtoV
…obbered-register probe The spec paragraph and the phases.toml summary say the INDIRECTs followed must belong to calls proven not to write the register (options.md and phase_catalog.json regenerated). New CLI probe passthrough-drops-a-register-an-unproven-call-may-clobber on fixture passthrough_clobbered_aarch64 (clang-21 AArch64 .so, recipe in the .c): check(int, char **) calls the import ext and then a variadic vlog without setting x2; it must keep two parameters and pass vlog no a2. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_0179iMKNhsvezm24JAGcKtoV
Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_0179iMKNhsvezm24JAGcKtoV
Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_0179iMKNhsvezm24JAGcKtoV
Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_0179iMKNhsvezm24JAGcKtoV
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.
[AUTOMATED] A function that returns a value it also uses as an array index prints as
void, even when its callers read the result.This is gnulib's
base_len, so grep, find and gzip carry it; find'sbase_nameanddir_lenare the same shape.Fix
score_forcedlets the returned value also be stored, branched on, or handed back in another register (returned_use). It now also lets the value be added to another non-constant value:name + len - 1makeslenan index, and the load that sum reaches is not a use oflenitself.Tests
tests/cli/voidret-a-returned-index-is-still-returned.json(fixturevoidret_indexed_x86_64, source beside it) fails without the change.voidgo from 79 to 75, and novoidfunction gains a return.Model:
anthropic/claude-opus-5-5:high