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

Konstantin Belochapka via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Aug 24 15:57:09 PDT 2017


kbelochapka 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(),
----------------
craig.topper wrote:
> 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.
you are absolutely right, will correct this


https://reviews.llvm.org/D36991





More information about the llvm-commits mailing list