1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2025-01-31 20:51:52 +01:00

Moved an access to an object past a NULL check,

making the MC disassembler tester more robust.

llvm-svn: 129175
This commit is contained in:
Sean Callanan 2011-04-09 00:21:04 +00:00
parent 7adf6f4b5c
commit b64c921079

View File

@ -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) {