Commit 71ef841
committed
Add checks and tests for computing abs(offset_bytes)
The previous code paniced if offset_bytes == i64::MIN. This commit:
- Properly computes the absoulte value to avoid this panic
- Adds a test for this edge case
Signed-off-by: Joe Richey <joerichey@google.com>1 parent 6367b54 commit 71ef841
File tree
3 files changed
+22
-3
lines changed- src
- librustc_mir/interpret
- test/ui/consts
3 files changed
+22
-3
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
10 | | - | |
| 10 | + | |
11 | 11 | | |
12 | 12 | | |
13 | 13 | | |
| |||
438 | 438 | | |
439 | 439 | | |
440 | 440 | | |
| 441 | + | |
441 | 442 | | |
442 | 443 | | |
443 | 444 | | |
| |||
450 | 451 | | |
451 | 452 | | |
452 | 453 | | |
453 | | - | |
| 454 | + | |
454 | 455 | | |
455 | 456 | | |
456 | 457 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
19 | 19 | | |
20 | 20 | | |
21 | 21 | | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
22 | 25 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
150 | 150 | | |
151 | 151 | | |
152 | 152 | | |
153 | | - | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
154 | 169 | | |
0 commit comments