From def8d7850b10baa4aaa201cf845a44ab7a93dd71 Mon Sep 17 00:00:00 2001 From: Matt Pharr Date: Tue, 28 Aug 2012 15:03:45 -0700 Subject: [PATCH] Fix crasher with malformed programs --- expr.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/expr.cpp b/expr.cpp index 358882b5..2f15f462 100644 --- a/expr.cpp +++ b/expr.cpp @@ -3995,7 +3995,10 @@ IndexExpr::GetValue(FunctionEmitContext *ctx) const { // Get a pointer type to the underlying elements const SequentialType *st = CastType(baseExprType); - AssertPos(pos, st != NULL); + if (st == NULL) { + Assert(m->errorCount > 0); + return NULL; + } lvType = PointerType::GetUniform(st->GetElementType()); // And do the indexing calculation into the temporary array in memory