Commit e42f862
authored
[BOLT][AArch64] Avoid UB due to shift of negative value. (#174994)
A build with LLVM_USE_SANITIZER=Undefined showed:
bolt/lib/Target/AArch64/AArch64MCPlusBuilder.cpp:2277:60:
runtime error: left shift of negative value -32768
This showed up in bolt/test/AArch64/veneer-lite-mode.s.
It is valid for ADRP's operand to be negative, and not valid to shift it
like that. To perform this shift reliably, cast the value to unsigned.1 parent 325869c commit e42f862
1 file changed
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2274 | 2274 | | |
2275 | 2275 | | |
2276 | 2276 | | |
2277 | | - | |
| 2277 | + | |
2278 | 2278 | | |
2279 | 2279 | | |
2280 | 2280 | | |
| |||
0 commit comments