Repository navigation
Conversation
…#2659) record_view_producer_origins marks a view whose receiver is a statement temporary (#962), so a binding or return of it is refused (§21.1). It read the receiver node's recorded type and place kind; a parenthesized receiver is an NK_GROUPED with no type of its own, so `(read_file(p) ?? "").trim()` and `(f().unwrap()).trim()` were accepted, and the binding read the freed temporary (a 141-byte title reached a child process as 142 empty arguments). The receiver's grouping is peeled before the check, as view_into_temporary_type already peels it. tools/corpus_bench.w had the shape twice and now binds the text first, as benchmarks/run.w does at four sites (the battery's benchmarks-check refused it once the fix landed). Test: test/compile_errors/err_2659_view_through_coalesce_temporary.w.
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.
record_view_producer_origins marks a view whose receiver is a statement
temporary (#962), so a binding or return of it is refused (§21.1). It read
the receiver node's recorded type and place kind; a parenthesized receiver
is an NK_GROUPED with no type of its own, so
(read_file(p) ?? "").trim()and
(f().unwrap()).trim()were accepted, and the binding read the freedtemporary (a 141-byte title reached a child process as 142 empty
arguments). The receiver's grouping is peeled before the check, as
view_into_temporary_type already peels it. tools/corpus_bench.w had the
shape twice and now binds the text first.
Test: test/compile_errors/err_2659_view_through_coalesce_temporary.w.
Closes #2659