Commit 1ac0a36
[dart/vm] Fix division-by-zero bug in range analysis
Rationale:
The attached test, a simplified version from a case found
by fuzzing, yielded the range [4,4] for the left hand side
of the division but [25,0] (sic!) for the right hand side.
This reverse range caused the logic in the TRUNC evaluation
to pass the >= 1 test but introduce the division by zero
in the compiler code. The true culprit, however, was
the reason for [25,0] which was due to a difference
in C++ and Dart shift right semantics. This CL fixes
the bug and adds some sanity assert to find more of
such cases.
#37622
Change-Id: I60e07428435d99589e1177c113ef5e24e1611d0e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/110420
Reviewed-by: Alexander Markov <[email protected]>
Reviewed-by: Ryan Macnak <[email protected]>
Commit-Queue: Aart Bik <[email protected]>1 parent 939cce7 commit 1ac0a36
File tree
3 files changed
+47
-2
lines changed- runtime/vm/compiler/backend
- tests/language_2/vm
3 files changed
+47
-2
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2442 | 2442 | | |
2443 | 2443 | | |
2444 | 2444 | | |
| 2445 | + | |
| 2446 | + | |
| 2447 | + | |
| 2448 | + | |
2445 | 2449 | | |
2446 | 2450 | | |
2447 | 2451 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
250 | 250 | | |
251 | 251 | | |
252 | 252 | | |
253 | | - | |
254 | | - | |
| 253 | + | |
| 254 | + | |
| 255 | + | |
| 256 | + | |
255 | 257 | | |
256 | 258 | | |
257 | 259 | | |
| |||
| 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 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
0 commit comments