Repository navigation
Conversation
`Struct2Local` rewrites expressions in a post-order walk while deferring `ReFinalize` until the end of the function walk. When an unescaping allocation flows into both a failing cast inside the `ref` operand of a `struct.atomic.rmw.cmpxchg`, `array.atomic.rmw.cmpxchg`, or nullable `ref.cast_desc_eq` and into its `expected` or `desc` operand, the inner cast is replaced with an unreachable block before the parent expression is visited. Because `ReFinalize` has not run yet, the parent's `curr->type` remains concrete while `curr->ref->type` is now `Type::unreachable`, causing `curr->ref->type.with(Nullable)` or `builder.addVar(func, curr->ref->type)` to fail assertions or produce invalid IR. Check for `curr->ref->type == Type::unreachable` in `visitStructCmpxchg`, `visitArrayCmpxchg`, and `visitRefCast`.
Member
|
Wait, wasn't that SIMD issue fixed by #9267 ? |
Member
Author
|
Yep, sorry. This got uploaded with the wrong PR title and message. Fixed now. This has happened a couple times now, so I'll try to add a safeguard against it in my local workflow. |
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.
Struct2Localrewrites expressions in a post-order walk while deferringReFinalizeuntil the end of the function walk. When an unescaping allocation flows into both a failing cast inside therefoperand of astruct.atomic.rmw.cmpxchg,array.atomic.rmw.cmpxchg, or nullableref.cast_desc_eqand into itsexpectedordescoperand, the inner cast is replaced with an unreachable block before the parent expression is visited. BecauseReFinalizehas not run yet, the parent'scurr->typeremains concrete whilecurr->ref->typeis nowType::unreachable, causingcurr->ref->type.with(Nullable)orbuilder.addVar(func, curr->ref->type)to fail assertions or produce invalid IR. Check forcurr->ref->type == Type::unreachableinvisitStructCmpxchg,visitArrayCmpxchg, andvisitRefCast.