Repository navigation
rc: a const read through an interface field or a handle's value holds a count - #651
Open
ASDAlexander77 wants to merge 1 commit into
Open
ASDAlexander77 wants to merge 1 commit into
ASDAlexander77 wants to merge 1 commit into
Conversation
… a count `const v = ix.v; ix.v = mv();` and `const v = GS.value; GS.value = mv();` freed what `v` still read: the const was folded into the read, which holds no count. #635 gave a const read out of a class field storage under rc; a read through an interface (ts.InterfaceSymbolRef) or out of a Shared<T> handle (ts.SharedValueRef) is a field read as well, and now gets the same. Under own the folded read stays a borrow, rejected when the place is overwritten. Fuzzer (#646) R2 and R7. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This branch has not been deployed
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 bugs R2 and R7 (#646): a const read through an interface field, or out of a
Shared<T>handle, dangled once that field got a new value.Why
A const read out of a place is folded into the read itself, so it holds no count of its own. #635 gave a const read out of a class field storage under rc (
readsField, throughts.PropertyRef). A read through an interface goes throughts.InterfaceSymbolRef, and a read of a handle's value goes throughts.SharedValueRef, so neither matched.Fix (rc only)
readsFieldnow recognises those two refs as well. Such a const gets storage like alet, as the class field, element and global cases already do (#635, #641, #642, #644, #647). Under own the folded read stays a borrow, and own rejects it when the place is overwritten.Tests
tests/00const_interface_field_read.tscovers:Each case fails under rc on its own without the fix (Linux). The test runs compiled, under JIT, and in the rc/none corpus.
Verification
ctest -C Release: Windows 4982/4982, WSL Linux 4964/4964.mm_fuzz.py --jobs 10 run --count 500 --seed 1: only the 3 known own failures (R1, O4).🤖 Generated with Claude Code