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

llvm-svn: 128904
This commit is contained in:
Shantonu Sen 2011-04-05 18:40:45 +00:00
parent d9dce561b6
commit e59f8ca49e
1 changed files with 4 additions and 2 deletions

View File

@ -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;