[llvm-commits] [llvm] r101293 - in /llvm/trunk/lib/Target/ARM/Disassembler: ARMDisassemblerCore.cpp ThumbDisassemblerCore.h
Johnny Chen
johnny.chen at apple.com
Wed Apr 14 15:04:45 PDT 2010
Author: johnny
Date: Wed Apr 14 17:04:45 2010
New Revision: 101293
URL: http://llvm.org/viewvc/llvm-project?rev=101293&view=rev
Log:
For t2BFI disassembly, apply the same error checking as in r101205.
Change the error msg to read "Encoding error: msb < lsb".
Modified:
llvm/trunk/lib/Target/ARM/Disassembler/ARMDisassemblerCore.cpp
llvm/trunk/lib/Target/ARM/Disassembler/ThumbDisassemblerCore.h
Modified: llvm/trunk/lib/Target/ARM/Disassembler/ARMDisassemblerCore.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ARM/Disassembler/ARMDisassemblerCore.cpp?rev=101293&r1=101292&r2=101293&view=diff
==============================================================================
--- llvm/trunk/lib/Target/ARM/Disassembler/ARMDisassemblerCore.cpp (original)
+++ llvm/trunk/lib/Target/ARM/Disassembler/ARMDisassemblerCore.cpp Wed Apr 14 17:04:45 2010
@@ -892,8 +892,8 @@
uint32_t lsb = slice(insn, 11, 7);
uint32_t msb = slice(insn, 20, 16);
uint32_t Val = 0;
- if (lsb > msb) {
- errs() << "Encoding error: lsb > msb\n";
+ if (msb < lsb) {
+ errs() << "Encoding error: msb < lsb\n";
return false;
}
Modified: llvm/trunk/lib/Target/ARM/Disassembler/ThumbDisassemblerCore.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ARM/Disassembler/ThumbDisassemblerCore.h?rev=101293&r1=101292&r2=101293&view=diff
==============================================================================
--- llvm/trunk/lib/Target/ARM/Disassembler/ThumbDisassemblerCore.h (original)
+++ llvm/trunk/lib/Target/ARM/Disassembler/ThumbDisassemblerCore.h Wed Apr 14 17:04:45 2010
@@ -1552,7 +1552,10 @@
Opcode == ARM::t2BFI) && "Invalid opcode");
MI.addOperand(MCOperand::CreateImm(getLsb(insn)));
if (Opcode == ARM::t2BFI) {
- assert(getMsb(insn) >= getLsb(insn) && "Encoding error");
+ if (getMsb(insn) < getLsb(insn)) {
+ errs() << "Encoding error: msb < lsb\n";
+ return false;
+ }
MI.addOperand(MCOperand::CreateImm(getMsb(insn) - getLsb(insn) + 1));
} else
MI.addOperand(MCOperand::CreateImm(getWidthMinus1(insn) + 1));
More information about the llvm-commits
mailing list