[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
Mon Nov 25 19:03:41 PST 2019
kbelochapka added a comment.
In D36991#1749597 <https://reviews.llvm.org/D36991#1749597>, @avl wrote:
> @kbelochapka Hi Konstantin, I am not sure whether you are still waiting for that review ... But if that is the case, Would you consider following comments, please ?
>
> 1. I think it would be better to limit checking for only "getFixupKindInfo(Fixup.getKind()).Flags && MCFixupKindInfo::FKF_IsPCRel" case. Since jrcxz/jecxz/jcxz instructions have only relative offset. i.e. report error for only PCRel fixups.
> 2. It also looks like check for offset needs to be limited to "IsResolved" case. Since if symbols are not resolved then actual offset is not known.
> 3. if not the #1 and #2 then use original assertion.
Something like that:
if (getFixupKindInfo(Fixup.getKind()).Flags && MCFixupKindInfo::FKF_IsPCRel && IsRelative) {
if (!isIntN(Size * 8, Value)) {
Asm.getContext().reportError(Fixup.getLoc(),
"Value " + Twine(int64_t(Value)) +
" does not fit in the Fixup field");
}
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D36991/new/
https://reviews.llvm.org/D36991
More information about the llvm-commits
mailing list