TType: Store array sizes vector as a pointer.

This makes TType a literal type, and thus is something that could be
constexpr.

Work started by jmadill here: https://crrev.com/c/776278

Bug: angleproject:1432
Change-Id: I707ddf81eaf029f49d62d2836b7166d265cbdfa1
Reviewed-on: https://chromium-review.googlesource.com/786316
Commit-Queue: Kai Ninomiya <kainino@chromium.org>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
diff --git a/src/compiler/translator/CollectVariables.cpp b/src/compiler/translator/CollectVariables.cpp
index 1fa86bb..bd8cbc9 100644
--- a/src/compiler/translator/CollectVariables.cpp
+++ b/src/compiler/translator/CollectVariables.cpp
@@ -262,8 +262,11 @@
     info->name       = name;
     info->mappedName = name;
     info->type       = GLVariableType(type);
-    info->arraySizes.assign(type.getArraySizes().begin(), type.getArraySizes().end());
     info->precision = GLVariablePrecision(type);
+    if (auto *arraySizes = type.getArraySizes())
+    {
+        info->arraySizes.assign(arraySizes->begin(), arraySizes->end());
+    }
 }
 
 void CollectVariablesTraverser::recordBuiltInVaryingUsed(const char *name,
@@ -581,7 +584,10 @@
     variableOut->name       = name.getString().c_str();
     variableOut->mappedName = getMappedName(name);
 
-    variableOut->arraySizes.assign(type.getArraySizes().begin(), type.getArraySizes().end());
+    if (auto *arraySizes = type.getArraySizes())
+    {
+        variableOut->arraySizes.assign(arraySizes->begin(), arraySizes->end());
+    }
 }
 
 Attribute CollectVariablesTraverser::recordAttribute(const TIntermSymbol &variable) const