diff --git a/Test/120.frag b/Test/120.frag index 40ab2ef4..89f88747 100644 --- a/Test/120.frag +++ b/Test/120.frag @@ -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; diff --git a/glslang/MachineIndependent/Intermediate.cpp b/glslang/MachineIndependent/Intermediate.cpp index e69caf99..9e3e04f7 100644 --- a/glslang/MachineIndependent/Intermediate.cpp +++ b/glslang/MachineIndependent/Intermediate.cpp @@ -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.