Repository navigation
Conversation
When walking the right-hand input's fallthrough chain in `OptimizeInstructions::areConsecutiveInputsEqual`, breaking out of the `ChildIterator` loop upon seeing the immediate fallthrough child skipped any subsequent children (such as the unreachable `ifFalse` arm of an `If`, a `Break` condition, or a `RefCast`/`BrOn` descriptor). While those children execute after (or instead of) the fallthrough expression when there is no enclosing loop, once the right-hand traversal enters a named `Loop`, control flow can cycle back so those skipped children execute on an earlier iteration before a subsequent evaluation of the fallthrough expression. For example, a `select` whose second arm was a `loop` containing an `if` with an unreachable `else` modifying a local and branching back to the loop falsely compared equal to the first arm and dropped the first arm. Track whether the right-hand fallthrough traversal has entered a named `Loop`, and once inside one, continue walking all remaining non-fallthrough children into `interferingEffects` rather than breaking at the immediate fallthrough child.
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.
When walking the right-hand input's fallthrough chain in
OptimizeInstructions::areConsecutiveInputsEqual, breaking out of theChildIteratorloop upon seeing the immediate fallthrough child skipped any subsequent children (such as the unreachableifFalsearm of anIf, aBreakcondition, or aRefCast/BrOndescriptor). While those children execute after (or instead of) the fallthrough expression when there is no enclosing loop, once the right-hand traversal enters a namedLoop, control flow can cycle back so those skipped children execute on an earlier iteration before a subsequent evaluation of the fallthrough expression. For example, aselectwhose second arm was aloopcontaining anifwith an unreachableelsemodifying a local and branching back to the loop falsely compared equal to the first arm and dropped the first arm.Track whether the right-hand fallthrough traversal has entered a named
Loop, and once inside one, continue walking all remaining non-fallthrough children intointerferingEffectsrather than breaking at the immediate fallthrough child.