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:
3a4d9b6
)
[lld-macho] Fix left shift of negative value UB
author
Daniel Bertalan
<dani@danielbertalan.dev>
Fri, 1 Jul 2022 09:47:34 +0000
(11:47 +0200)
committer
Daniel Bertalan
<dani@danielbertalan.dev>
Fri, 1 Jul 2022 10:00:16 +0000
(12:00 +0200)
I introduced this mistake in
573c7e6b3c79c7ce80a2221e000fab7dd20c0bb4
.
Fixes the failure on this UBSan bot:
https://lab.llvm.org/buildbot/#/builders/5/builds/25537
lld/MachO/Arch/ARM64.cpp
patch
|
blob
|
history
diff --git
a/lld/MachO/Arch/ARM64.cpp
b/lld/MachO/Arch/ARM64.cpp
index
93941f4
..
7064df5
100644
(file)
--- a/
lld/MachO/Arch/ARM64.cpp
+++ b/
lld/MachO/Arch/ARM64.cpp
@@
-264,7
+264,7
@@
static void writeAdr(void *loc, uint32_t dest, int32_t delta) {
static void writeNop(void *loc) { write32le(loc, 0xd503201f); }
static void writeLiteralLdr(void *loc, Ldr original, int32_t delta) {
- uint32_t imm19 = (delta
<< 3) & 0x00ffffe0
;
+ uint32_t imm19 = (delta
& 0x001ffffc) << 3
;
uint32_t opcode = 0;
switch (original.size) {
case 4: