Commit 5968a6f
[release/10.0] Fix off-by-one error in TypePreinit switch instruction handling (#127587)
Backport of #123911 to release/10.0
/cc @agocke @sbomer
## Customer Impact
- [x] Customer reported
- [ ] Found internally
When the value exactly equals the case count, the code tried to read a
non-existent jump table entry, corrupting the IL reader offset and
causing an IndexOutOfRangeException during NativeAOT compilation.
## Regression
- [ ] Yes
- [X] No
## Testing
Unit tests
## Risk
Low
Co-authored-by: Sven Boemer <sbomer@gmail.com>1 parent fc46e69 commit 5968a6f
2 files changed
Lines changed: 3 additions & 1 deletion
File tree
- src
- coreclr/tools/aot/ILCompiler.Compiler/Compiler
- tests/nativeaot/SmokeTests/Preinitialization
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1272 | 1272 | | |
1273 | 1273 | | |
1274 | 1274 | | |
1275 | | - | |
| 1275 | + | |
1276 | 1276 | | |
1277 | 1277 | | |
1278 | 1278 | | |
| |||
Lines changed: 2 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
813 | 813 | | |
814 | 814 | | |
815 | 815 | | |
| 816 | + | |
816 | 817 | | |
817 | 818 | | |
818 | 819 | | |
| |||
837 | 838 | | |
838 | 839 | | |
839 | 840 | | |
| 841 | + | |
840 | 842 | | |
841 | 843 | | |
842 | 844 | | |
| |||
0 commit comments