Commit 8d00fd0e by John Kessenich

Add missing type check for operands having the same type (after conversion)…

Add missing type check for operands having the same type (after conversion) around the ":" in a "?:" operation. git-svn-id: https://cvs.khronos.org/svn/repos/ogl/trunk/ecosystem/public/sdk/tools/glslang@21721 e7fa87d3-cd2b-0410-9028-fcbf551c1848
parent 2d0f1e54
...@@ -71,6 +71,13 @@ void main() ...@@ -71,6 +71,13 @@ void main()
float uvec3; float uvec3;
float uvec4; float uvec4;
//packed; // ERROR, reserved word //packed; // ERROR, reserved word
{
mat4 m;
vec4 v;
bool b;
gl_FragColor += b ? v : m; // ERROR, types don't match around ":"
}
} }
float imageBuffer; float imageBuffer;
......
...@@ -769,6 +769,10 @@ TIntermTyped* TIntermediate::addSelection(TIntermTyped* cond, TIntermTyped* true ...@@ -769,6 +769,10 @@ TIntermTyped* TIntermediate::addSelection(TIntermTyped* cond, TIntermTyped* true
else else
return 0; 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. // See if all the operands are constant, then fold it otherwise not.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment