Disallow arrays in initializers for non-array-object versions (assignment, etc. were...
authorJohn Kessenich <cepheus@frii.com>
Tue, 12 Nov 2013 22:02:36 +0000 (22:02 +0000)
committerJohn Kessenich <cepheus@frii.com>
Tue, 12 Nov 2013 22:02:36 +0000 (22:02 +0000)
git-svn-id: https://cvs.khronos.org/svn/repos/ogl/trunk/ecosystem/public/sdk/tools/glslang@24022 e7fa87d3-cd2b-0410-9028-fcbf551c1848

Test/array100.frag
Test/baseResults/100.frag.out
Test/baseResults/array100.frag.out
glslang/MachineIndependent/ParseHelper.cpp

index beedfec..b77aedf 100644 (file)
@@ -66,4 +66,5 @@ void bar11()
     s1 = s2;   // ERROR
     bar10(s1);
     s2 = bar9(); // ERROR
+    SB initSb = s1;  // ERROR
 }
index 1c08f35..9a5c37e 100644 (file)
@@ -1,5 +1,6 @@
 ERROR: 0:3: '{ } style initializers' : not supported with this profile: es\r
 ERROR: 0:3: 'initializer' : not supported for this version or the enabled extensions \r
+ERROR: 0:3: 'array initializer' : not supported for this version or the enabled extensions \r
 ERROR: 0:7: 'attribute' : not supported in this stage: fragment\r
 ERROR: 0:7: 'float' : type requires declaration of default precision qualifier \r
 ERROR: 0:9: '=' :  cannot convert from 'const int' to 'mediump float'\r
@@ -60,7 +61,7 @@ ERROR: 0:144: 'a' : redefinition
 ERROR: 0:149: 'floating-point suffix' : not supported for this version or the enabled extensions \r
 ERROR: 0:150: 'floating-point suffix' : not supported for this version or the enabled extensions \r
 ERROR: 0:152: '' :  syntax error\r
-ERROR: 55 compilation errors.  No code generated.\r
+ERROR: 56 compilation errors.  No code generated.\r
 \r
 ERROR: node is still EOpNull!\r
 0:3  Sequence\r
index 5302806..8223f4b 100644 (file)
@@ -19,7 +19,8 @@ ERROR: 0:39: '[' :  index out of range '-1'
 ERROR: 0:53: 'array in function return type' : not supported for this version or the enabled extensions \r
 ERROR: 0:66: 'array assignment' : not supported for this version or the enabled extensions \r
 ERROR: 0:68: 'array assignment' : not supported for this version or the enabled extensions \r
-ERROR: 21 compilation errors.  No code generated.\r
+ERROR: 0:69: 'array initializer' : not supported for this version or the enabled extensions \r
+ERROR: 22 compilation errors.  No code generated.\r
 \r
 ERROR: node is still EOpNull!\r
 0:9  Function Definition: foo(f1[5]; (4-element array of mediump float)\r
@@ -143,6 +144,10 @@ ERROR: node is still EOpNull!
 0:68      move second child to first child (structure{v4,sa})\r
 0:68        's2' (structure{v4,sa})\r
 0:68        Function Call: bar9( (structure{v4,sa})\r
+0:69      Sequence\r
+0:69        move second child to first child (structure{v4,sa})\r
+0:69          'initSb' (structure{v4,sa})\r
+0:69          's1' (structure{v4,sa})\r
 0:?   Linker Objects\r
 0:?     'gu' (unsized array of mediump float)\r
 0:?     'g4' (4-element array of mediump float)\r
index f23b37e..765c885 100644 (file)
@@ -2927,6 +2927,7 @@ TIntermNode* TParseContext::executeInitializer(TSourceLoc loc, TString& identifi
         error(loc, " cannot initialize this type of qualifier ", variable->getType().getStorageQualifierString(), "");
         return 0;
     }
+    arrayObjectCheck(loc, variable->getType(), "array initializer");
 
     //
     // If the initializer was from braces { ... }, we convert the whole subtree to a