Repository navigation
rc: hold an argument whose place a later argument overwrites under another name - #663
Merged
Merged
Conversation
…other name `f7((p12.n = mk(7), p12.n), (HG.n = mk(9), p13))` with `p12` being `HG`: the first argument is read out of `p12.n`, and the second argument's `HG.n = mk(9)` gives back the block it read. The caller holds an argument whose place is overwritten between the read and the call (#653), but samePlace compared places by name. A store to one field of another object of the same class, or to an element of another array of the same type, may be the same place, and now holds the argument as well. Fuzzer (#646), 80037. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.
Fixes fuzzer repro 80037 (#646), found in a fresh range (80001). It fails on main.
Why
The first argument is read out of
p12.n. The second argument'sHG.n = mk(9)then gives back the block it read, becausep12isHG. #653 holds an argument when something between its read and the call overwrites its place, butsamePlacecompares places by name, so it treatedp12.nandHG.nas different places.HGbeingconstdoesn't matter; aletcrashes the same way.Fix (rc only)
overwrittenBeforeCalluses a new helper,mayBeSamePlace, which issamePlaceplus two cases:Which object a value is can't be known here, so such a store may be an overwrite, and the argument is held. That costs one extra retain/release pair, and only when an argument list assigns such a place.
readFromOtherArgumentstill usessamePlace.Tests
tests/00argument_place_aliased.tscovers a field reached through a parameter that is:It also covers an element reached through another parameter that is the same array. Each case crashes on its own under rc on Linux without the fix, and the test passes under gc. It runs compiled, under JIT, and in the rc/none corpus.
Verification
ctest -C Release: Windows 5316/5316, measured before An element is stored into once the value is ready #658 was merged in (that merge had no conflicts).🤖 Generated with Claude Code