Fix up r137380 based on post-commit review by Jim Grosbach.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@138948 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
James Molloy
2011-09-01 18:02:14 +00:00
parent 7f17b5a483
commit c047dcade5
4 changed files with 627 additions and 612 deletions

View File

@ -239,14 +239,19 @@ EDInst *EDDisassembler::createInst(EDByteReaderCallback byteReader,
MCInst* inst = new MCInst;
uint64_t byteSize;
if (!Disassembler->getInstruction(*inst,
byteSize,
memoryObject,
address,
ErrorStream)) {
MCDisassembler::DecodeStatus S;
S = Disassembler->getInstruction(*inst,
byteSize,
memoryObject,
address,
ErrorStream);
switch (S) {
case MCDisassembler::Fail:
case MCDisassembler::SoftFail:
// FIXME: Do something different on soft failure mode?
delete inst;
return NULL;
} else {
case MCDisassembler::Success: {
const llvm::EDInstInfo *thisInstInfo = NULL;
if (InstInfos) {
@ -256,6 +261,7 @@ EDInst *EDDisassembler::createInst(EDByteReaderCallback byteReader,
EDInst* sdInst = new EDInst(inst, byteSize, *this, thisInstInfo);
return sdInst;
}
}
}
void EDDisassembler::initMaps(const MCRegisterInfo &registerInfo) {