Fix bug in AddElementOffset() error checking.

This commit is contained in:
Matt Pharr
2012-05-18 11:57:05 -07:00
parent 22d584f302
commit 4d1eb94dfd

View File

@@ -2211,7 +2211,7 @@ FunctionEmitContext::AddElementOffset(llvm::Value *fullBasePtr, int elementNum,
if (llvmPtrType != NULL) {
llvm::StructType *llvmStructType =
llvm::dyn_cast<llvm::StructType>(llvmPtrType->getElementType());
if (llvmStructType->isSized() == false) {
if (llvmStructType != NULL && llvmStructType->isSized() == false) {
Assert(m->errorCount > 0);
return NULL;
}