Add missing type check for operands having the same type (after conversion) around...
authorJohn Kessenich <cepheus@frii.com>
Tue, 28 May 2013 07:29:58 +0000 (07:29 +0000)
committerJohn Kessenich <cepheus@frii.com>
Tue, 28 May 2013 07:29:58 +0000 (07:29 +0000)
git-svn-id: https://cvs.khronos.org/svn/repos/ogl/trunk/ecosystem/public/sdk/tools/glslang@21721 e7fa87d3-cd2b-0410-9028-fcbf551c1848

Test/120.frag
glslang/MachineIndependent/Intermediate.cpp

index 40ab2ef4e6c3631b85f25a8be8a5d64b16d63389..89f88747afa44e83ccf0998a947519ebb6df7d79 100644 (file)
@@ -71,6 +71,13 @@ void main()
     float uvec3;
     float uvec4;
     //packed;     // ERROR, reserved word
+
+    {
+        mat4 m;
+        vec4 v;
+        bool b;
+        gl_FragColor += b ? v : m;  // ERROR, types don't match around ":"
+    }
 }
 
 float imageBuffer;
index e69caf99f1fac7b6b512d4dc3272d237f5e5b719..9e3e04f7bb4bca190e9364c0afd9747974644540 100644 (file)
@@ -769,6 +769,10 @@ TIntermTyped* TIntermediate::addSelection(TIntermTyped* cond, TIntermTyped* true
         else
             return 0;
     }
+    
+    // After conversion, types have to match.
+    if (falseBlock->getType() != trueBlock->getType())
+        return 0;
 
     //
     // See if all the operands are constant, then fold it otherwise not.