Fixed no diagnostic message problem for out of range fixup value for loop/loope/loopne/jcxz/jecxz/jrcxz instructions.
Details
Diff Detail
Event Timeline
lib/Target/X86/MCTargetDesc/X86AsmBackend.cpp | ||
---|---|---|
153–165 | Why is this (Size * 8) - 1 now? |
lib/Target/X86/MCTargetDesc/X86AsmBackend.cpp | ||
---|---|---|
153–165 | signed 8 bit PC relative value |
lib/Target/X86/MCTargetDesc/X86AsmBackend.cpp | ||
---|---|---|
153–165 | To detect if something is a signed 8 bit value, isIntN expects to be passed 8. Not 7. |
lib/Target/X86/MCTargetDesc/X86AsmBackend.cpp | ||
---|---|---|
153–165 | you are absolutely right, will correct this |
Reimplemented fixup overflow check, treat PC relative fixup values as signed values and absolute fixup values as unsigned values.
Craig, can you please when you have chance, review the update that I had made for the initial fix of the bug.
@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 ?
- 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.
- 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.
- 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"); }
Hi Konstantin, yes, I had in mind something like this. Unfortunately, I noticed your answer after D70652 was integrated : https://reviews.llvm.org/rGe73f78acd34360f7450b81167d9dc858ccddc262
Hi Alexey,
To be honest, that is a first time when I see that happened.
Do you have any idea what needs to be done in this situation?
Hi Konstantin, That review looked stuck for a long time.
I tried to keep all your original authority - ping original review,
waited for response for a week, added link to your review into the new review,
put your authority in the commit message.
Apologies for not waiting longer.
Why is this (Size * 8) - 1 now?