|
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>
|