glsl: Add missing location info to case labels.
authorEric Anholt <eric@anholt.net>
Mon, 30 Jan 2012 17:41:55 +0000 (09:41 -0800)
committerEric Anholt <eric@anholt.net>
Fri, 3 Feb 2012 10:06:57 +0000 (11:06 +0100)
Otherwise, the upcoming error messages said the location was 0:0(0).

NOTE: This is a candidate for the 8.0 branch.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
src/glsl/glsl_parser.yy

index e774b4697ad8fb381b54f59599a38a62b7d02424..8368d063a6dc33f18deb7a2f5a40c6eee3ae89e3 100644 (file)
@@ -1691,10 +1691,12 @@ case_label:
        CASE expression ':'
        {
           $$ = new(state) ast_case_label($2);
+          $$->set_location(yylloc);
        }
        | DEFAULT ':'
        {
           $$ = new(state) ast_case_label(NULL);
+          $$->set_location(yylloc);
        }
        ;