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