projects
/
platform
/
upstream
/
llvm.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
b3ed6e5
)
[BOLT][NFC] Fix UB due to left shift of negative value
author
Job Noorman
<jnoorman@igalia.com>
Thu, 13 Apr 2023 12:29:18 +0000
(14:29 +0200)
committer
Job Noorman
<jnoorman@igalia.com>
Thu, 13 Apr 2023 12:29:19 +0000
(14:29 +0200)
The following test fails when enabling UBSan due to a left shift of a
negative value:
> runtime error: left shift of negative value -2
BOLT :: AArch64/ext-island-ref.s
This patch fixes this by using a multiplication instead of a shift.
Reviewed By: yota9
Differential Revision: https://reviews.llvm.org/D148218
bolt/lib/Target/AArch64/AArch64MCPlusBuilder.cpp
patch
|
blob
|
history
diff --git
a/bolt/lib/Target/AArch64/AArch64MCPlusBuilder.cpp
b/bolt/lib/Target/AArch64/AArch64MCPlusBuilder.cpp
index
ec9f78d
..
90016ed
100644
(file)
--- a/
bolt/lib/Target/AArch64/AArch64MCPlusBuilder.cpp
+++ b/
bolt/lib/Target/AArch64/AArch64MCPlusBuilder.cpp
@@
-265,7
+265,7
@@
public:
return true;
}
- DispImm = Inst.getOperand(I).getImm()
<< 2
;
+ DispImm = Inst.getOperand(I).getImm()
* 4
;
return true;
}
return false;