[PATCH] D23501: Correct the upper bound for a CBZ/CBNZ branch target.

Oliver Stannard via llvm-commits llvm-commits at lists.llvm.org
Mon Aug 15 06:09:21 PDT 2016


olista01 added inline comments.

================
Comment at: lib/Target/ARM/MCTargetDesc/ARMAsmBackend.cpp:582
@@ -581,3 +581,3 @@
     // CB instructions can only branch to offsets in [0, 126] in multiples of 2
-    if (Ctx && ((int64_t)Value < 0 || Value > 0x3e || Value & 1)) {
+    if (Ctx && ((int64_t)Value < 0 || Value > 0x80 || Value & 1)) {
       Ctx->reportError(Fixup.getLoc(), "out of range pc-relative fixup value");
----------------
The 4-byte offset is being applied a few lines down, so should this actually be checking for the range [4, 130]?


https://reviews.llvm.org/D23501





More information about the llvm-commits mailing list