Misc. constant-folding fixes: Check % for 0, mat(mat) constructor, index range checking (within constant objects). Also, rationalize addConst*() methods.

git-svn-id: https://cvs.khronos.org/svn/repos/ogl/trunk/ecosystem/public/sdk/tools/glslang@23973 e7fa87d3-cd2b-0410-9028-fcbf551c1848
This commit is contained in:
John Kessenich
2013-11-08 21:47:56 +00:00
parent 6d7fe63d76
commit 0876a58203
9 changed files with 245 additions and 114 deletions

View File

@@ -6,12 +6,12 @@ ERROR: 0:31: 'assign' : cannot convert from '4-element array of float' to 'unsi
ERROR: 0:33: 'foo' : no matching overloaded function found
ERROR: 0:42: '[' : array index out of range '5'
ERROR: 0:45: '[' : array index out of range '1000'
ERROR: 0:46: '[' : array index out of range '-1'
ERROR: 0:52: '[' : array index '2' out of range
ERROR: 0:46: '[' : index out of range '-1'
ERROR: 0:52: '[' : array index out of range '2'
ERROR: 0:54: 'const' : non-matching or non-convertible constant type for const initializer
ERROR: 0:56: '=' : cannot convert from 'const 2-element array of int' to '3-element array of int'
ERROR: 0:57: '[]' : scalar integer expression required
ERROR: 0:57: '[' : array index out of range '-858993459'
ERROR: 0:57: '[' : index out of range '-858993459'
ERROR: 0:58: '[]' : scalar integer expression required
ERROR: 14 compilation errors. No code generated.
@@ -157,7 +157,7 @@ ERROR: node is still EOpNull!
0:52 add second child into first child (int)
0:52 'sum' (int)
0:52 Constant:
0:52 3 (const int)
0:52 2 (const int)
0:55 Sequence
0:55 move second child to first child (2-element array of int)
0:55 'ica' (2-element array of int)

View File

@@ -14,7 +14,7 @@ ERROR: 0:31: 'arrayed constructor' : not supported for this version or the enabl
ERROR: 0:31: 'array comparison' : not supported for this version or the enabled extensions
ERROR: 0:35: '[' : array index out of range '5'
ERROR: 0:38: '[' : array index out of range '1000'
ERROR: 0:39: '[' : array index out of range '-1'
ERROR: 0:39: '[' : index out of range '-1'
ERROR: 17 compilation errors. No code generated.
ERROR: node is still EOpNull!

View File

@@ -1,5 +1,13 @@
Warning, version 430 is not yet complete; some version-specific features are present, but many are missing.
0:? Sequence
ERROR: 0:109: '[' : index out of range '-1'
ERROR: 0:110: '[' : vector index out of range '4'
ERROR: 0:111: '[' : index out of range '-2'
ERROR: 0:112: '[' : index out of range '-1'
ERROR: 0:113: '[' : vector index out of range '3'
ERROR: 0:114: '[' : matrix index out of range '3'
ERROR: 6 compilation errors. No code generated.
ERROR: node is still EOpNull!
0:28 Function Definition: main( (void)
0:28 Function Parameters:
0:30 Sequence
@@ -163,6 +171,51 @@ Warning, version 430 is not yet complete; some version-specific features are pre
0:81 0 (const int)
0:81 Constant:
0:81 7.000000
0:82 Constant:
0:82 2 (const int)
0:83 Constant:
0:83 2147483647 (const int)
0:84 Constant:
0:84 1.#INF00
0:88 Constant:
0:88 2 (const uint)
0:88 3 (const uint)
0:89 Constant:
0:89 0 (const uint)
0:90 Constant:
0:90 6 (const uint)
0:90 7 (const uint)
0:103 Function Definition: foo2( (void)
0:103 Function Parameters:
0:105 Sequence
0:105 direct index (float)
0:105 'a1' (1-element array of float)
0:105 Constant:
0:105 0 (const int)
0:106 direct index (float)
0:106 'a2' (2-element array of float)
0:106 Constant:
0:106 0 (const int)
0:107 direct index (float)
0:107 'a3' (4-element array of float)
0:107 Constant:
0:107 0 (const int)
0:108 direct index (float)
0:108 'a4' (2-element array of float)
0:108 Constant:
0:108 0 (const int)
0:109 Constant:
0:109 1.000000
0:110 Constant:
0:110 5.000000
0:111 Constant:
0:111 2.000000
0:112 Constant:
0:112 3.000000
0:113 Constant:
0:113 0.000000
0:114 Constant:
0:114 0.000000
0:? Linker Objects
0:? 'a' (const int)
0:? 1 (const int)
@@ -209,4 +262,32 @@ Warning, version 430 is not yet complete; some version-specific features are pre
0:? 6.000000
0:? 7.000000
0:? 8.000000
0:? 'm2' (const 2X2 matrix of float)
0:? 2.000000
0:? 3.000000
0:? 4.000000
0:? 5.000000
0:? 'm3' (const 3X3 matrix of float)
0:? 2.000000
0:? 3.000000
0:? 0.000000
0:? 4.000000
0:? 5.000000
0:? 0.000000
0:? 0.000000
0:? 0.000000
0:? 1.000000
0:? 'mc' (const int)
0:? 1 (const int)
0:? 'a1' (1-element array of float)
0:? 'a2' (2-element array of float)
0:? 'a3' (4-element array of float)
0:? 'v2' (const 2-component vector of float)
0:? 1.000000
0:? 2.000000
0:? 'v3' (const 3-component vector of float)
0:? 3.000000
0:? 4.000000
0:? 5.000000
0:? 'a4' (2-element array of float)

View File

@@ -3,8 +3,8 @@ ERROR: 0:7: 'const' : non-matching or non-convertible constant type for const in
ERROR: 0:17: 'assign' : cannot convert from '2-component vector of float' to '3-component vector of float'
ERROR: 0:18: 'assign' : cannot convert from '2-component vector of float' to '3-component vector of float'
ERROR: 0:19: '.' : field selection not allowed on matrix
ERROR: 0:21: '[' : index out of range '2'
ERROR: 0:21: '[' : index out of range '4'
ERROR: 0:21: '[' : matrix index out of range '2'
ERROR: 0:21: '[' : vector index out of range '4'
ERROR: 7 compilation errors. No code generated.
ERROR: node is still EOpNull!