From 06428f3d1137b4570371fb011f014732fddd8d84 Mon Sep 17 00:00:00 2001 From: Lars-Peter Clausen Date: Sat, 29 Jul 2023 12:23:31 -0700 Subject: [PATCH] Make sure `const var` variables are constant Commit 3daa2982acb2 ("Add support for `const` variables") added support for constant variables, but had a small mistake and did propagate the constant flag from the parser if the variable is declared with the `var` keyword. Still allowing to modify those variables. 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 92e8c73ef..24c3a27a0 100644 --- a/parse.y +++ b/parse.y @@ -2738,7 +2738,7 @@ block_item_decl data_type = new vector_type_t(IVL_VT_LOGIC, false, 0); FILE_NAME(data_type, @2); } - pform_make_var(@2, $5, data_type, attributes_in_context); + pform_make_var(@2, $5, data_type, attributes_in_context, $1); var_lifetime = LexicalScope::INHERITED; }