google/graphicsfuzz

gfauto: If/else statements missing braces after pretty printing

Vihanakangas opened this issue · 1 comments

As seen in the example below, after gfauto has reduced a found crash it should have formatted the variant shader and the reference shader. This should include adding braces where needed. However, this has not happened in a case where a "bad image" bug was found:

Reference:

...
        else
         if(int(gl_FragCoord[1]) < 270)
          {
           grey = 0.5 + float(data[8]) / 10.0;
          }
         else
          {
           discard;
          }
 _GLF_color = vec4(vec3(grey), 1.0);
...

Variant:

...
                   else
                    {
                     if(int(gl_FragCoord[1]) < 270)
                      {
                       grey = 0.5 + float(data[8]) / 10.0;
                      }
                     else
                      {
                       discard;
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    }
  }
 _GLF_color = vec4(vec3(grey), 1.0);
...

Two shaders were missing braces, so I added them manually. Merged in #995