From 4d1eb94dfd5470402633fcb8ccba8d297f3ed732 Mon Sep 17 00:00:00 2001 From: Matt Pharr Date: Fri, 18 May 2012 11:57:05 -0700 Subject: [PATCH] Fix bug in AddElementOffset() error checking. --- ctx.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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; }