Program: 70881
Project: 70881
Buggy source:
private static void buildFragmentShaderMain(StringBuilder mb,GLSLInfo info){
  appendln(mb,"String_Node_Str");
  appendln(mb,"String_Node_Str");
  appendln(mb,"String_Node_Str");
  boolean lights=false;
  if (info.getShading() != Shading.NONE && info.numLights() > 0) {
    lights=true;
    appendln(mb,"String_Node_Str");
    appendln(mb,"String_Node_Str");
switch (info.getShading()) {
case FLAT:
case GOURAUD:
      appendln(mb,"String_Node_Str");
    appendln(mb,"String_Node_Str");
  appendln(mb,"String_Node_Str");
appendln(mb,"String_Node_Str");
appendln(mb,"String_Node_Str");
appendln(mb,"String_Node_Str");
appendln(mb,"String_Node_Str");
appendln(mb,"String_Node_Str");
appendln(mb,"String_Node_Str");
appendln(mb,"String_Node_Str");
appendln(mb,"String_Node_Str");
appendln(mb,"String_Node_Str");
appendln(mb);
case PHONG:
appendln(mb,"String_Node_Str");
appendln(mb,"String_Node_Str");
appendln(mb,"String_Node_Str");
appendln(mb,"String_Node_Str");
appendln(mb,"String_Node_Str");
appendln(mb,"String_Node_Str");
appendln(mb,"String_Node_Str");
appendln(mb,"String_Node_Str");
appendln(mb,"String_Node_Str");
appendln(mb,"String_Node_Str");
appendln(mb,"String_Node_Str");
appendln(mb,"String_Node_Str");
appendln(mb,"String_Node_Str");
appendln(mb,"String_Node_Str" + info.numLights() + "String_Node_Str");
appendln(mb,"String_Node_Str");
appendln(mb,"String_Node_Str");
appendln(mb,"String_Node_Str");
appendln(mb,"String_Node_Str");
appendln(mb,"String_Node_Str");
appendln(mb,"String_Node_Str");
appendln(mb,"String_Node_Str");
appendln(mb,"String_Node_Str");
appendln(mb,"String_Node_Str");
appendln(mb,"String_Node_Str");
appendln(mb,"String_Node_Str");
appendln(mb,"String_Node_Str");
appendln(mb,"String_Node_Str");
appendln(mb,"String_Node_Str");
appendln(mb,"String_Node_Str");
appendln(mb,"String_Node_Str");
appendln(mb,"String_Node_Str");
appendln(mb,"String_Node_Str");
appendln(mb,"String_Node_Str");
appendln(mb,"String_Node_Str");
appendln(mb,"String_Node_Str");
appendln(mb,"String_Node_Str");
appendln(mb,"String_Node_Str");
appendln(mb,"String_Node_Str");
appendln(mb,"String_Node_Str");
appendln(mb,"String_Node_Str");
appendln(mb,"String_Node_Str");
appendln(mb,"String_Node_Str");
appendln(mb,"String_Node_Str");
appendln(mb,"String_Node_Str");
appendln(mb,"String_Node_Str");
appendln(mb,"String_Node_Str");
break;
case NONE:
break;
}
}
 else {
appendln(mb,"String_Node_Str");
appendln(mb,"String_Node_Str");
appendln(mb,"String_Node_Str");
appendln(mb,"String_Node_Str");
appendln(mb,"String_Node_Str");
appendln(mb,"String_Node_Str");
appendln(mb,"String_Node_Str");
}
InstancedRendering instanced=info.getInstancedRendering();
ColorInterpolation cinterp=info.getColorInterpolation();
boolean hasColors=(cinterp != ColorInterpolation.NONE) && (info.hasVertexColors() || ((instanced == InstancedRendering.POINTS || instanced == InstancedRendering.FRAMES || instanced == InstancedRendering.AFFINES) && info.hasInstanceColors()) || (instanced == InstancedRendering.LINES && info.hasLineColors()));
boolean hasTextures=info.hasVertexTextures() || ((instanced == InstancedRendering.POINTS || instanced == InstancedRendering.FRAMES || instanced == InstancedRendering.AFFINES) && info.hasInstanceTextures()) || (instanced == InstancedRendering.LINES && info.hasLineTextures());
appendln(mb,"String_Node_Str");
appendln(mb,"String_Node_Str");
if (hasColors) {
appendln(mb,"String_Node_Str");
if (cinterp == ColorInterpolation.HSV) {
appendln(mb,"String_Node_Str");
}
 else {
appendln(mb,"String_Node_Str");
}
appendln(mb,"String_Node_Str");
ColorMixing cmix=info.getColorMixing();
switch (cmix) {
case DECAL:
appendln(mb,"String_Node_Str");
break;
case MODULATE:
appendln(mb,"String_Node_Str");
break;
case REPLACE:
appendln(mb,"String_Node_Str");
break;
case NONE:
appendln(mb,"String_Node_Str");
default :
}
}
if (hasTextures) {
appendln(mb,"String_Node_Str");
appendln(mb,"String_Node_Str");
ColorMixing cmix=info.getColorMixing();
switch (cmix) {
case DECAL:
appendln(mb,"String_Node_Str");
break;
case MODULATE:
appendln(mb,"String_Node_Str");
break;
case REPLACE:
appendln(mb,"String_Node_Str");
case NONE:
appendln(mb,"String_Node_Str");
default :
}
}
if (lights) {
appendln(mb,"String_Node_Str");
appendln(mb,"String_Node_Str");
appendln(mb,"String_Node_Str");
appendln(mb,"String_Node_Str");
appendln(mb,"String_Node_Str");
appendln(mb,"String_Node_Str");
}
appendln(mb,"String_Node_Str");
appendln(mb,"String_Node_Str");
}

Fixed version (ground truth):
private static void buildFragmentShaderMain(StringBuilder mb,GLSLInfo info){
  appendln(mb,"String_Node_Str");
  appendln(mb,"String_Node_Str");
  appendln(mb,"String_Node_Str");
  boolean lights=false;
  if (info.getShading() != Shading.NONE && info.numLights() > 0) {
    lights=true;
    appendln(mb,"String_Node_Str");
    appendln(mb,"String_Node_Str");
switch (info.getShading()) {
case FLAT:
case GOURAUD:
      appendln(mb,"String_Node_Str");
    appendln(mb,"String_Node_Str");
  appendln(mb,"String_Node_Str");
appendln(mb,"String_Node_Str");
appendln(mb,"String_Node_Str");
appendln(mb,"String_Node_Str");
appendln(mb,"String_Node_Str");
appendln(mb,"String_Node_Str");
appendln(mb,"String_Node_Str");
appendln(mb,"String_Node_Str");
appendln(mb,"String_Node_Str");
appendln(mb,"String_Node_Str");
appendln(mb);
break;
case PHONG:
appendln(mb,"String_Node_Str");
appendln(mb,"String_Node_Str");
appendln(mb,"String_Node_Str");
appendln(mb,"String_Node_Str");
appendln(mb,"String_Node_Str");
appendln(mb,"String_Node_Str");
appendln(mb,"String_Node_Str");
appendln(mb,"String_Node_Str");
appendln(mb,"String_Node_Str");
appendln(mb,"String_Node_Str");
appendln(mb,"String_Node_Str");
appendln(mb,"String_Node_Str");
appendln(mb,"String_Node_Str");
appendln(mb,"String_Node_Str" + info.numLights() + "String_Node_Str");
appendln(mb,"String_Node_Str");
appendln(mb,"String_Node_Str");
appendln(mb,"String_Node_Str");
appendln(mb,"String_Node_Str");
appendln(mb,"String_Node_Str");
appendln(mb,"String_Node_Str");
appendln(mb,"String_Node_Str");
appendln(mb,"String_Node_Str");
appendln(mb,"String_Node_Str");
appendln(mb,"String_Node_Str");
appendln(mb,"String_Node_Str");
appendln(mb,"String_Node_Str");
appendln(mb,"String_Node_Str");
appendln(mb,"String_Node_Str");
appendln(mb,"String_Node_Str");
appendln(mb,"String_Node_Str");
appendln(mb,"String_Node_Str");
appendln(mb,"String_Node_Str");
appendln(mb,"String_Node_Str");
appendln(mb,"String_Node_Str");
appendln(mb,"String_Node_Str");
appendln(mb,"String_Node_Str");
appendln(mb,"String_Node_Str");
appendln(mb,"String_Node_Str");
appendln(mb,"String_Node_Str");
appendln(mb,"String_Node_Str");
appendln(mb,"String_Node_Str");
appendln(mb,"String_Node_Str");
appendln(mb,"String_Node_Str");
appendln(mb,"String_Node_Str");
appendln(mb,"String_Node_Str");
appendln(mb,"String_Node_Str");
break;
case NONE:
break;
}
}
 else {
appendln(mb,"String_Node_Str");
appendln(mb,"String_Node_Str");
appendln(mb,"String_Node_Str");
appendln(mb,"String_Node_Str");
appendln(mb,"String_Node_Str");
appendln(mb,"String_Node_Str");
appendln(mb,"String_Node_Str");
}
InstancedRendering instanced=info.getInstancedRendering();
ColorInterpolation cinterp=info.getColorInterpolation();
boolean hasColors=(cinterp != ColorInterpolation.NONE) && (info.hasVertexColors() || ((instanced == InstancedRendering.POINTS || instanced == InstancedRendering.FRAMES || instanced == InstancedRendering.AFFINES) && info.hasInstanceColors()) || (instanced == InstancedRendering.LINES && info.hasLineColors()));
boolean hasTextures=info.hasVertexTextures() || ((instanced == InstancedRendering.POINTS || instanced == InstancedRendering.FRAMES || instanced == InstancedRendering.AFFINES) && info.hasInstanceTextures()) || (instanced == InstancedRendering.LINES && info.hasLineTextures());
appendln(mb,"String_Node_Str");
appendln(mb,"String_Node_Str");
if (hasColors) {
appendln(mb,"String_Node_Str");
if (cinterp == ColorInterpolation.HSV) {
appendln(mb,"String_Node_Str");
}
 else {
appendln(mb,"String_Node_Str");
}
appendln(mb,"String_Node_Str");
ColorMixing cmix=info.getColorMixing();
switch (cmix) {
case DECAL:
appendln(mb,"String_Node_Str");
break;
case MODULATE:
appendln(mb,"String_Node_Str");
break;
case REPLACE:
appendln(mb,"String_Node_Str");
break;
case NONE:
appendln(mb,"String_Node_Str");
default :
}
}
if (hasTextures) {
appendln(mb,"String_Node_Str");
appendln(mb,"String_Node_Str");
ColorMixing cmix=info.getColorMixing();
switch (cmix) {
case DECAL:
appendln(mb,"String_Node_Str");
break;
case MODULATE:
appendln(mb,"String_Node_Str");
break;
case REPLACE:
appendln(mb,"String_Node_Str");
case NONE:
appendln(mb,"String_Node_Str");
default :
}
}
if (lights) {
appendln(mb,"String_Node_Str");
appendln(mb,"String_Node_Str");
appendln(mb,"String_Node_Str");
appendln(mb,"String_Node_Str");
appendln(mb,"String_Node_Str");
appendln(mb,"String_Node_Str");
}
appendln(mb,"String_Node_Str");
appendln(mb,"String_Node_Str");
}