[PATCH] D36991: [x86] [MC] fixed no error diagnostic for out-of-range jrcxz/jecxz/jcxz (PR24072)

Craig Topper via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Aug 24 15:36:56 PDT 2017


craig.topper added inline comments.


================
Comment at: lib/Target/X86/MCTargetDesc/X86AsmBackend.cpp:124
     // other assemblers.
-    assert(isIntN(Size * 8 + 1, Value) &&
-           "Value does not fit in the Fixup field");
+    if (!isIntN((Size * 8) - 1, Value)) {
+      Asm.getContext().reportError(Fixup.getLoc(),
----------------
kbelochapka wrote:
> craig.topper wrote:
> > Why is this (Size * 8) - 1 now?
> signed 8 bit PC relative value
To detect if something is a signed 8 bit value, isIntN expects to be passed 8. Not 7.


https://reviews.llvm.org/D36991





More information about the llvm-commits mailing list