diff mbox series

[nft,1/3] parser_bison: fix error location for set elements

Message ID 20220518180435.298462-1-pablo@netfilter.org
State Accepted
Delegated to: Pablo Neira
Headers show
Series [nft,1/3] parser_bison: fix error location for set elements | expand

Commit Message

Pablo Neira Ayuso May 18, 2022, 6:04 p.m. UTC
opt_newline causes interfere since it points to the previous line.
Refer to set element key for error reporting.

Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
---
 src/parser_bison.y | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Comments

Pablo Neira Ayuso June 27, 2022, 10:31 a.m. UTC | #1
On Wed, May 18, 2022 at 08:04:33PM +0200, Pablo Neira Ayuso wrote:
> opt_newline causes interfere since it points to the previous line.
> Refer to set element key for error reporting.

For the record, pushed out this series with minor comestic updates.
diff mbox series

Patch

diff --git a/src/parser_bison.y b/src/parser_bison.y
index ca5c488cd5ff..e03fb35d96c7 100644
--- a/src/parser_bison.y
+++ b/src/parser_bison.y
@@ -2915,7 +2915,7 @@  verdict_map_list_expr	:	verdict_map_list_member_expr
 
 verdict_map_list_member_expr:	opt_newline	set_elem_expr	COLON	verdict_expr	opt_newline
 			{
-				$$ = mapping_expr_alloc(&@$, $2, $4);
+				$$ = mapping_expr_alloc(&@2, $2, $4);
 			}
 			;
 
@@ -4263,7 +4263,7 @@  set_list_member_expr	:	opt_newline	set_expr	opt_newline
 			}
 			|	opt_newline	set_elem_expr	COLON	set_rhs_expr	opt_newline
 			{
-				$$ = mapping_expr_alloc(&@$, $2, $4);
+				$$ = mapping_expr_alloc(&@2, $2, $4);
 			}
 			;