diff --git a/ctx.cpp b/ctx.cpp index e15ee72b..896f9346 100644 --- a/ctx.cpp +++ b/ctx.cpp @@ -2211,7 +2211,7 @@ FunctionEmitContext::AddElementOffset(llvm::Value *fullBasePtr, int elementNum, if (llvmPtrType != NULL) { llvm::StructType *llvmStructType = llvm::dyn_cast(llvmPtrType->getElementType()); - if (llvmStructType->isSized() == false) { + if (llvmStructType != NULL && llvmStructType->isSized() == false) { Assert(m->errorCount > 0); return NULL; }