Fix malformed program crashes.
This commit is contained in:
5
expr.cpp
5
expr.cpp
@@ -3050,7 +3050,10 @@ IndexExpr::GetValue(FunctionEmitContext *ctx) const {
|
|||||||
|
|
||||||
const SequentialType *st =
|
const SequentialType *st =
|
||||||
dynamic_cast<const SequentialType *>(baseExprType);
|
dynamic_cast<const SequentialType *>(baseExprType);
|
||||||
assert(st != NULL);
|
if (st == NULL) {
|
||||||
|
assert(m->errorCount > 0);
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
lvalueType = PointerType::GetUniform(st->GetElementType());
|
lvalueType = PointerType::GetUniform(st->GetElementType());
|
||||||
|
|
||||||
lvalue = lAddVaryingOffsetsIfNeeded(ctx, lvalue, lvalueType);
|
lvalue = lAddVaryingOffsetsIfNeeded(ctx, lvalue, lvalueType);
|
||||||
|
|||||||
5
type.cpp
5
type.cpp
@@ -353,7 +353,10 @@ AtomicType::Mangle() const {
|
|||||||
std::string
|
std::string
|
||||||
AtomicType::GetCDeclaration(const std::string &name) const {
|
AtomicType::GetCDeclaration(const std::string &name) const {
|
||||||
std::string ret;
|
std::string ret;
|
||||||
assert(isUniform);
|
if (isUniform == false) {
|
||||||
|
assert(m->errorCount > 0);
|
||||||
|
return ret;
|
||||||
|
}
|
||||||
if (isConst) ret += "const ";
|
if (isConst) ret += "const ";
|
||||||
|
|
||||||
switch (basicType) {
|
switch (basicType) {
|
||||||
|
|||||||
Reference in New Issue
Block a user