[PATCH] D148218: [BOLT][NFC] Fix UB due to left shift of negative value

Job Noorman via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Apr 13 05:29:49 PDT 2023


This revision was automatically updated to reflect the committed changes.
Closed by commit rGdf3f1e2f3130: [BOLT][NFC] Fix UB due to left shift of negative value (authored by jobnoorman).

Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D148218/new/

https://reviews.llvm.org/D148218

Files:
  bolt/lib/Target/AArch64/AArch64MCPlusBuilder.cpp


Index: bolt/lib/Target/AArch64/AArch64MCPlusBuilder.cpp
===================================================================
--- bolt/lib/Target/AArch64/AArch64MCPlusBuilder.cpp
+++ bolt/lib/Target/AArch64/AArch64MCPlusBuilder.cpp
@@ -265,7 +265,7 @@
         return true;
       }
 
-      DispImm = Inst.getOperand(I).getImm() << 2;
+      DispImm = Inst.getOperand(I).getImm() * 4;
       return true;
     }
     return false;


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D148218.513188.patch
Type: text/x-patch
Size: 430 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20230413/b84d62b5/attachment.bin>


More information about the llvm-commits mailing list