Commit f37d193
committed
[stack-switching] Fix type index conflation in the translation of
The translation of `switch` would erroneously decompose a
`ModuleInternedTypeIndex` and use its `u32` representation to build a
`TypeIndex`. The two index types map different spaces, consequently it
is possible to cause a compiler crash (out of bounds on lookup) or
worse a runtime crash (argument types mismatch).switch
1 parent ac07729 commit f37d193
3 files changed
Lines changed: 46 additions & 2 deletions
File tree
- crates/cranelift/src
- translate
- tests/misc_testsuite/stack-switching
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5584 | 5584 | | |
5585 | 5585 | | |
5586 | 5586 | | |
| 5587 | + | |
| 5588 | + | |
| 5589 | + | |
| 5590 | + | |
| 5591 | + | |
| 5592 | + | |
| 5593 | + | |
| 5594 | + | |
| 5595 | + | |
5587 | 5596 | | |
5588 | 5597 | | |
5589 | 5598 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3335 | 3335 | | |
3336 | 3336 | | |
3337 | 3337 | | |
3338 | | - | |
| 3338 | + | |
3339 | 3339 | | |
3340 | 3340 | | |
3341 | | - | |
| 3341 | + | |
3342 | 3342 | | |
3343 | 3343 | | |
3344 | 3344 | | |
| |||
Lines changed: 35 additions & 0 deletions
| 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 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
0 commit comments