Repository navigation
Commit 50131be
JIT: Reject native-int bounds checks in range check cloning (#135725)
`BoundsCheckInfo::Initialize` only checked the index type on the
non-constant path. A `TYP_LONG` constant index (e.g. `arr[(nint)0]`,
whose bounds check also has a `CAST(long <- ARR_LENGTH)` length) passed
`IsIntCnsFitsInI32()` and was accepted, while
`optRangeCheckCloning_DoClone` builds the guards as `TYP_INT`, producing
mixed int/long relops (asserts in Checked, invalid IR in Release).
Fix: reject bounds checks whose index or length isn't `TYP_INT` up
front. No asm diffs in libraries.pmi.
Fixes #134459
No
[diffs](https://dev.azure.com/dnceng-public/public/_build/results?buildId=1634108&view=ms.vss-build-web.run-extensions-tab).
Co-authored-by: Copilot <[email protected]>
Copilot-Session: ef747772-3030-470e-b839-f9a4fc1167171 parent d24a264 commit 50131be
2 files changed
Lines changed: 31 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
68 | 68 | | |
69 | 69 | | |
70 | 70 | | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
71 | 77 | | |
72 | 78 | | |
73 | 79 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
0 commit comments