From 445454bd392c48db7ac290db4a0a524685cc354d Mon Sep 17 00:00:00 2001 From: Nick Gasson Date: Sat, 12 Aug 2023 11:28:43 +0100 Subject: [PATCH] Fix regression of vhpi9 test case --- src/lower.c | 3 ++- test/regress/testlist.txt | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/src/lower.c b/src/lower.c index 1b496f466..7d511fce1 100644 --- a/src/lower.c +++ b/src/lower.c @@ -2691,7 +2691,8 @@ static vcode_reg_t lower_link_var(lower_unit_t *lu, tree_t decl) istr(tree_ident(decl))); } } - else if (lu->mode == LOWER_THUNK && lu->parent == NULL) { + else if (lu->mode == LOWER_THUNK && lu->parent == NULL + && tree_has_value(decl)) { // Handle a special case of simplifying locally static expressions // that reference constant declarations assert(tree_kind(decl) == T_CONST_DECL); diff --git a/test/regress/testlist.txt b/test/regress/testlist.txt index ccda75e9b..a9ba61398 100644 --- a/test/regress/testlist.txt +++ b/test/regress/testlist.txt @@ -848,3 +848,4 @@ open1 normal,2019 issue750 normal,2008 order3 shell driver18 normal,2008 +vhpi9 normal,vhpi