[llvm-commits] [llvm] r129175 - /llvm/trunk/tools/llvm-mc/Disassembler.cpp
Sean Callanan
scallanan at apple.com
Fri Apr 8 17:21:04 PDT 2011
Author: spyffe
Date: Fri Apr 8 19:21:04 2011
New Revision: 129175
URL: http://llvm.org/viewvc/llvm-project?rev=129175&view=rev
Log:
Moved an access to an object past a NULL check,
making the MC disassembler tester more robust.
Modified:
llvm/trunk/tools/llvm-mc/Disassembler.cpp
Modified: llvm/trunk/tools/llvm-mc/Disassembler.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/llvm-mc/Disassembler.cpp?rev=129175&r1=129174&r2=129175&view=diff
==============================================================================
--- llvm/trunk/tools/llvm-mc/Disassembler.cpp (original)
+++ llvm/trunk/tools/llvm-mc/Disassembler.cpp Fri Apr 8 19:21:04 2011
@@ -240,12 +240,12 @@
OwningPtr<EDInst>
inst(disassembler->createInst(byteArrayReader, 0, &ByteArray));
- ByteArray.erase (ByteArray.begin(), ByteArray.begin() + inst->byteSize());
-
if (inst == 0) {
errs() << "error: Didn't get an instruction\n";
return -1;
}
+
+ ByteArray.erase (ByteArray.begin(), ByteArray.begin() + inst->byteSize());
unsigned numTokens = inst->numTokens();
if ((int)numTokens < 0) {
More information about the llvm-commits
mailing list