Fix malformed program crashes.

This commit is contained in:
Matt Pharr
2011-12-08 14:35:12 -08:00
parent a79bc75b72
commit aec7da740a
2 changed files with 8 additions and 2 deletions

View File

@@ -3050,7 +3050,10 @@ IndexExpr::GetValue(FunctionEmitContext *ctx) const {
const SequentialType *st =
dynamic_cast<const SequentialType *>(baseExprType);
assert(st != NULL);
if (st == NULL) {
assert(m->errorCount > 0);
return NULL;
}
lvalueType = PointerType::GetUniform(st->GetElementType());
lvalue = lAddVaryingOffsetsIfNeeded(ctx, lvalue, lvalueType);