diff options
author | Shantonu Sen <ssen@apple.com> | 2011-04-05 18:40:45 +0000 |
---|---|---|
committer | Shantonu Sen <ssen@apple.com> | 2011-04-05 18:40:45 +0000 |
commit | 0da9f13faa696759150fa29e42e5ee107ee0b712 (patch) | |
tree | 2d00f4fc3d4d3975964a30f7c519a8c576d27412 /lib/MC/MCDisassembler | |
parent | 215e4fdbf9da460cb5e2d42a8df96530534ec382 (diff) | |
download | external_llvm-0da9f13faa696759150fa29e42e5ee107ee0b712.zip external_llvm-0da9f13faa696759150fa29e42e5ee107ee0b712.tar.gz external_llvm-0da9f13faa696759150fa29e42e5ee107ee0b712.tar.bz2 |
An MCDisassembler has the option to not implement
getEDInfo(), in which case this code would dereference
NULL. EDInst can already handle NULL info, so avoid
the dereference and pass NULL through.
Reviewed by Sean Callanan
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@128904 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/MC/MCDisassembler')
-rw-r--r-- | lib/MC/MCDisassembler/EDDisassembler.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/lib/MC/MCDisassembler/EDDisassembler.cpp b/lib/MC/MCDisassembler/EDDisassembler.cpp index f679647..e36b3a4 100644 --- a/lib/MC/MCDisassembler/EDDisassembler.cpp +++ b/lib/MC/MCDisassembler/EDDisassembler.cpp @@ -254,9 +254,11 @@ EDInst *EDDisassembler::createInst(EDByteReaderCallback byteReader, delete inst; return NULL; } else { - const llvm::EDInstInfo *thisInstInfo; + const llvm::EDInstInfo *thisInstInfo = NULL; - thisInstInfo = &InstInfos[inst->getOpcode()]; + if (InstInfos) { + thisInstInfo = &InstInfos[inst->getOpcode()]; + } EDInst* sdInst = new EDInst(inst, byteSize, *this, thisInstInfo); return sdInst; |