projects
/
babeltrace.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Fix: add semantic check in grammar
[babeltrace.git]
/
formats
/
ctf
/
metadata
/
ctf-parser.y
diff --git
a/formats/ctf/metadata/ctf-parser.y
b/formats/ctf/metadata/ctf-parser.y
index 188f8cd44e0c1d9cce191b9a6ccb37450ffb08f7..58ea245b8d30f2b43b17cb26b7a8a72594bd0dc2 100644
(file)
--- a/
formats/ctf/metadata/ctf-parser.y
+++ b/
formats/ctf/metadata/ctf-parser.y
@@
-1225,7
+1225,13
@@
unary_expression:
postfix_expression
{ $$ = $1; }
| PLUS postfix_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;
| MINUS postfix_expression
{
$$ = $2;
This page took
0.02413 seconds
and
4
git commands to generate.