[release/10.0] Ignore re-typed lcl in optAssertionPropLocal_RelOp #119813
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.
Backport of #119797 to release/10.0
/cc @EgorBo
Customer Impact
In certain patterns involving downcasting long to int JIT could fold branches where it was not legal leading to silent codegen bugs. In case of the customer's repro that was an unexpected IndexOutOfBoundsException thrown.
Regression
It doesn't reproduce on .NET 9.0, but it looks like the actual regression was introduced long time ago and some unrelated change just uncovered it in 10.0.
Testing
Customer's scenario is tested locally and a small test is added
Risk
Low, the change just makes an optimization slightly more conservative