OSDN Git Service

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 e774b46..8368d06 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);
        }
        ;