src/compiler/translator/ValidateSwitch.cpp


Log

Author Commit Date CI Message
Olli Etuaho c8716df9 2015-02-26T17:17:22 Fix an issue with handling an error case inside ValidateSwitch In case a condition with a wrong type is given to a case statement, it generates an error but the compiler recovers. This caused ValidateSwitch to assert. Fix this. BUG=angle:921 Change-Id: I7949798cab923c2b168817471896470c6c611878 Reviewed-on: https://chromium-review.googlesource.com/254080 Reviewed-by: Zhenyao Mo <zmo@chromium.org> Tested-by: Olli Etuaho <oetuaho@nvidia.com> Reviewed-by: Jamie Madill <jmadill@chromium.org>
Olli Etuaho ac5274df 2015-02-20T10:19:08 Add validation for the structure of switch statements Implement a traverser to check for the following errors: -More than one default or replicated constant expression -No statement between a label and the end of a switch statement -Statements in a switch statement before the first case statement -Mismatch between the type of init-expression and type of a case label -Case or default label nested inside other control flow nested within the corresponding switch Tested by manually disabling shading language version checks for switch and by manually enabling case statements in a Chromium build and checking that the expected errors are generated. BUG=angle:921 Change-Id: I99c49c17c8b520849adbe4d8521e46cb10e20e41 Reviewed-on: https://chromium-review.googlesource.com/251524 Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Olli Etuaho <oetuaho@nvidia.com> Tested-by: Olli Etuaho <oetuaho@nvidia.com>