From d0408040367250e1d659b4118d45b2cdb6d72f7d Mon Sep 17 00:00:00 2001 From: Lars-Peter Clausen Date: Mon, 12 Jun 2023 08:59:17 -0700 Subject: [PATCH] parser: Fix line location for implicit named port connections The implicitly generated identifier for implicit named port connections gets its file and line information from the optional attributes. If no attribute list is specified this will just point to the beginning of the file resulting in incorrect line information. Use the file and line information from the identifier token instead to fix this. Signed-off-by: Lars-Peter Clausen --- parse.y | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/parse.y b/parse.y index d997c858e..8c548476c 100644 --- a/parse.y +++ b/parse.y @@ -5731,7 +5731,7 @@ port_name { named_pexpr_t*tmp = new named_pexpr_t; tmp->name = lex_strings.make($3); tmp->parm = new PEIdent(lex_strings.make($3), true); - FILE_NAME(tmp->parm, @1); + FILE_NAME(tmp->parm, @3); delete[]$3; delete $1; $$ = tmp;