diff options
author | James Molloy <james.molloy@arm.com> | 2011-09-01 22:01:14 +0000 |
---|---|---|
committer | James Molloy <james.molloy@arm.com> | 2011-09-01 22:01:14 +0000 |
commit | ee06443945b4c9f471c9b80c4325075dbc27746e (patch) | |
tree | 56202c2704bf286723a233f737e189fbcc78a8ae /lib/MC/MCDisassembler/EDDisassembler.cpp | |
parent | 6bb4e7e8e8c39432c890bedb800bb01f6eda1e44 (diff) |
Fix apparent build error caused by r138948 on certain versions of GCC with -Werror. Sorry for the inconvenience.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@138973 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/MC/MCDisassembler/EDDisassembler.cpp')
-rw-r--r-- | lib/MC/MCDisassembler/EDDisassembler.cpp | 26 |
1 files changed, 17 insertions, 9 deletions
diff --git a/lib/MC/MCDisassembler/EDDisassembler.cpp b/lib/MC/MCDisassembler/EDDisassembler.cpp index 14d735dbc7..68a201b96a 100644 --- a/lib/MC/MCDisassembler/EDDisassembler.cpp +++ b/lib/MC/MCDisassembler/EDDisassembler.cpp @@ -239,20 +239,28 @@ EDInst *EDDisassembler::createInst(EDByteReaderCallback byteReader, MCInst* inst = new MCInst; uint64_t byteSize; - if (Disassembler->getInstruction(*inst, byteSize, memoryObject, address, - ErrorStream) != MCDisassembler::Success) { + 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; - } - const llvm::EDInstInfo *thisInstInfo = NULL; + + case MCDisassembler::Success: { + const llvm::EDInstInfo *thisInstInfo = NULL; - if (InstInfos) { - thisInstInfo = &InstInfos[inst->getOpcode()]; - } + if (InstInfos) { + thisInstInfo = &InstInfos[inst->getOpcode()]; + } - EDInst* sdInst = new EDInst(inst, byteSize, *this, thisInstInfo); - return sdInst; + EDInst* sdInst = new EDInst(inst, byteSize, *this, thisInstInfo); + return sdInst; + } + } + return NULL; } void EDDisassembler::initMaps(const MCRegisterInfo ®isterInfo) { |