[llvm-commits] [llvm] r91898 - /llvm/trunk/tools/llvm-mc/HexDisassembler.cpp
Chris Lattner
sabre at nondot.org
Mon Dec 21 22:58:29 PST 2009
Author: lattner
Date: Tue Dec 22 00:58:29 2009
New Revision: 91898
URL: http://llvm.org/viewvc/llvm-project?rev=91898&view=rev
Log:
reject invalid input with a caret, e.g.:
simple-tests.txt:16:1: error: invalid instruction
0xff 0xff
^
Modified:
llvm/trunk/tools/llvm-mc/HexDisassembler.cpp
Modified: llvm/trunk/tools/llvm-mc/HexDisassembler.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/llvm-mc/HexDisassembler.cpp?rev=91898&r1=91897&r2=91898&view=diff
==============================================================================
--- llvm/trunk/tools/llvm-mc/HexDisassembler.cpp (original)
+++ llvm/trunk/tools/llvm-mc/HexDisassembler.cpp Tue Dec 22 00:58:29 2009
@@ -61,8 +61,8 @@
llvm::raw_string_ostream verboseOS(verboseOStr);
if (!DisAsm.getInstruction(Inst, Size, memoryObject, 0, verboseOS)) {
- // FIXME: Caret.
- errs() << "error: invalid instruction\n";
+ SM.PrintMessage(SMLoc::getFromPointer(Bytes[0].second),
+ "invalid instruction", "error");
errs() << "Diagnostic log:" << '\n';
errs() << verboseOS.str() << '\n';
return true;
More information about the llvm-commits
mailing list