From 4b9c3ec0da2d4b188fffb226212950b84125f24c Mon Sep 17 00:00:00 2001 From: Matt Pharr Date: Wed, 29 Feb 2012 14:25:58 -0800 Subject: [PATCH] Fix bug in StructType::GetElementType(). We were only resolving unbound variability for the top-level type, which isn't enough if we have e.g. an unbound-variability pointer pointing to some type with unbound variability. --- type.cpp | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/type.cpp b/type.cpp index cb863a01..a30a74db 100644 --- a/type.cpp +++ b/type.cpp @@ -2094,12 +2094,8 @@ StructType::GetElementType(int i) const { // If the element has unbound variability, resolve its variability to // the struct type's variability - if (ret->HasUnboundVariability()) { - if (variability == Varying) - ret = ret->GetAsVaryingType(); - else - ret = ret->GetAsUniformType(); - } + ret = ret->ResolveUnboundVariability(variability); + return isConst ? ret->GetAsConstType() : ret; }