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 7bdaed671d
commit a1467abb18

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;