From d88dbf3612f6241318d38d29ba6b68077ce50d30 Mon Sep 17 00:00:00 2001 From: Matt Pharr Date: Thu, 12 Apr 2012 11:40:28 -0700 Subject: [PATCH] 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. --- expr.cpp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/expr.cpp b/expr.cpp index a804d733..b6955bc3 100644 --- a/expr.cpp +++ b/expr.cpp @@ -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); }