diff options
author | Sean Callanan <scallanan@apple.com> | 2011-04-09 00:21:04 +0000 |
---|---|---|
committer | Sean Callanan <scallanan@apple.com> | 2011-04-09 00:21:04 +0000 |
commit | 052aa2c256acebab662b6099b155057d4092c3cf (patch) | |
tree | 6064f004ff390aef027ebd948564ea83066c3736 | |
parent | f03a3383f99b2123ba01dbc138a816c0f733950e (diff) |
Moved an access to an object past a NULL check,
making the MC disassembler tester more robust.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@129175 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r-- | tools/llvm-mc/Disassembler.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/tools/llvm-mc/Disassembler.cpp b/tools/llvm-mc/Disassembler.cpp index 41b92a1b30..cdd1892f25 100644 --- a/tools/llvm-mc/Disassembler.cpp +++ b/tools/llvm-mc/Disassembler.cpp @@ -240,12 +240,12 @@ int Disassembler::disassembleEnhanced(const std::string &TS, 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) { |