diff --git a/expr.cpp b/expr.cpp index a87a26cc..a3f2f52b 100644 --- a/expr.cpp +++ b/expr.cpp @@ -3050,7 +3050,10 @@ IndexExpr::GetValue(FunctionEmitContext *ctx) const { const SequentialType *st = dynamic_cast(baseExprType); - assert(st != NULL); + if (st == NULL) { + assert(m->errorCount > 0); + return NULL; + } lvalueType = PointerType::GetUniform(st->GetElementType()); lvalue = lAddVaryingOffsetsIfNeeded(ctx, lvalue, lvalueType); diff --git a/type.cpp b/type.cpp index 725320c5..84538d23 100644 --- a/type.cpp +++ b/type.cpp @@ -353,7 +353,10 @@ AtomicType::Mangle() const { std::string AtomicType::GetCDeclaration(const std::string &name) const { std::string ret; - assert(isUniform); + if (isUniform == false) { + assert(m->errorCount > 0); + return ret; + } if (isConst) ret += "const "; switch (basicType) {