Fix two bugs with resolving unbound variability.

We still need to call ResolveUnboundVariability even if the
type returns false from HasUnboundVariability; we may have,
for example, a pointer type where the pointer is resolved,
but the pointed-to type is unresolved.

Fixes issue #228.
This commit is contained in:
Matt Pharr
2012-04-12 11:40:28 -07:00
parent 2a18efef82
commit d88dbf3612

View File

@@ -7292,8 +7292,7 @@ SizeOfExpr::SizeOfExpr(Expr *e, SourcePos p)
SizeOfExpr::SizeOfExpr(const Type *t, SourcePos p)
: Expr(p), expr(NULL), type(t) {
if (type->HasUnboundVariability())
type = type->ResolveUnboundVariability(Variability::Varying);
type = type->ResolveUnboundVariability(Variability::Varying);
}
@@ -7970,7 +7969,7 @@ NewExpr::NewExpr(int typeQual, const Type *t, Expr *init, Expr *count,
// varying new.
isVarying = (typeQual == 0) || (typeQual & TYPEQUAL_VARYING);
if (allocType != NULL && allocType->HasUnboundVariability())
if (allocType != NULL)
allocType = allocType->ResolveUnboundVariability(Variability::Uniform);
}