[PATCH] Change llvm-objdump to print (bad) for invalid instructions
Jim Grosbach
grosbach at apple.com
Wed Oct 16 11:56:40 PDT 2013
On Oct 16, 2013, at 11:49 AM, Stephen Checkoway <s at pahtak.org> wrote:
>
> On Oct 16, 2013, at 2:25 PM, Stephen Checkoway <s at pahtak.org> wrote:
>
>>
>> On Oct 16, 2013, at 2:05 PM, Jim Grosbach <grosbach at apple.com> wrote:
>>
>>> I don’t think you want to always set the size to ‘1’ here. Won’t that result in mis-aligned instruction decoding for fixed-width instruction sets?
>>
>>
>> That's a good point and there's a similar issue in MCObjectDisassemble.cpp. I wasn't sure if DisAsm::getInstruction() would set Size if it returns false but, looking closer at the code, I think it does.
>>
>> I'll fix this and also the MCObjectDisassembler patch I sent a little while ago that Rafael said he was going to look at.
>
> Attached.
>
LGTM. Perhaps also adjust the documentation header comment for getInstruction() to reflect that size must always return non-zero?
> If you get a moment to look at the MCInstrAnalysis::evaluateBranch() patch and suggest the correct way to fix it, that'd be great.
>
> --
> Stephen Checkoway
>
>
> <llvm-objdump-invalid-opcode.diff>
>
>
More information about the llvm-commits
mailing list