summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorPablo Neira Ayuso <pablo@netfilter.org>2016-01-12 13:43:05 +0100
committerPablo Neira Ayuso <pablo@netfilter.org>2016-01-13 13:02:41 +0100
commit85d6803b3fc3f80cd84ce1fe74c0c46c732438a4 (patch)
tree8666293ea3d55aa58319f31c019103de509f2842 /src
parent5fb625af9e89db915451992d8920b4fa353a1185 (diff)
parser_bison: initializer_expr must use rhs_expr
Use rhs_expr and list_rhs_expr as possible occurrences of initializer_expr since we may only find constant expressions on the right hand side of the assignment. Fixes: 2a5d44d8b3c (parser: get rid of multiton_expr from lhs relational expression) Reported-by: Arturo Borrero Gonzalez <arturo.borrero.glez@gmail.com> Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org> Tested-by: Florian Westphal <fw@strlen.de> Tested-by: Arturo Borrero Gonzalez <arturo.borrero.glez@gmail.com>
Diffstat (limited to 'src')
-rw-r--r--src/parser_bison.y20
1 files changed, 2 insertions, 18 deletions
diff --git a/src/parser_bison.y b/src/parser_bison.y
index fcd4813e..fcf84b9a 100644
--- a/src/parser_bison.y
+++ b/src/parser_bison.y
@@ -490,8 +490,6 @@ static void location_update(struct location *loc, struct location *rhs, int n)
%type <expr> stmt_expr concat_stmt_expr map_stmt_expr
%destructor { expr_free($$); } stmt_expr concat_stmt_expr map_stmt_expr
-%type <expr> list_expr
-%destructor { expr_free($$); } list_expr
%type <expr> concat_expr
%destructor { expr_free($$); } concat_expr
@@ -1854,20 +1852,6 @@ concat_expr : basic_expr
}
;
-list_expr : basic_expr COMMA basic_expr
- {
- $$ = list_expr_alloc(&@$);
- compound_expr_add($$, $1);
- compound_expr_add($$, $3);
- }
- | list_expr COMMA basic_expr
- {
- $1->location = @$;
- compound_expr_add($1, $3);
- $$ = $1;
- }
- ;
-
prefix_rhs_expr : basic_rhs_expr SLASH NUM
{
$$ = prefix_expr_alloc(&@$, $1, $3);
@@ -1976,8 +1960,8 @@ set_rhs_expr : concat_rhs_expr
| verdict_expr
;
-initializer_expr : expr
- | list_expr
+initializer_expr : rhs_expr
+ | list_rhs_expr
;
relational_expr : expr /* implicit */ rhs_expr