Fix: add semantic check in grammar
authorEtienne Bergeron <etienneb@google.com>
Tue, 2 Apr 2013 23:24:22 +0000 (19:24 -0400)
committerMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Tue, 2 Apr 2013 23:30:28 +0000 (19:30 -0400)
Signed-off-by: Etienne Bergeron <etienneb@google.com>
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
formats/ctf/metadata/ctf-parser.y

index 188f8cd44e0c1d9cce191b9a6ccb37450ffb08f7..58ea245b8d30f2b43b17cb26b7a8a72594bd0dc2 100644 (file)
@@ -1225,7 +1225,13 @@ unary_expression:
                postfix_expression
                {       $$ = $1;                                }
        |       PLUS postfix_expression
-               {       $$ = $2;                                }
+               {
+                       $$ = $2;
+                       if ($$->u.unary_expression.type != UNARY_UNSIGNED_CONSTANT
+                               && $$->u.unary_expression.type != UNARY_SIGNED_CONSTANT) {
+                               reparent_error(scanner, "expecting numeric constant");
+                       }
+               }
        |       MINUS postfix_expression
                {
                        $$ = $2;
This page took 0.024491 seconds and 4 git commands to generate.