From 0a4b795900c1fe11eb78f9ff7d2dec985a4295e7 Mon Sep 17 00:00:00 2001 From: ALEXks Date: Wed, 7 May 2025 15:00:01 +0300 Subject: [PATCH] fixed module utils --- src/Utils/module_utils.cpp | 17 +++++++++++++---- src/Utils/version.h | 2 +- 2 files changed, 14 insertions(+), 5 deletions(-) diff --git a/src/Utils/module_utils.cpp b/src/Utils/module_utils.cpp index 0d03161..055e658 100644 --- a/src/Utils/module_utils.cpp +++ b/src/Utils/module_utils.cpp @@ -310,8 +310,17 @@ static void getModuleSymbols(SgStatement* func, set& symbs) SgSymbol* s = func->symbol()->next(); while (s) { - if (IS_BY_USE(s) && s->scope() && s->scope()->symbol()->identifier() == currScope) - symbs.insert(s); + if (func->variant() == MODULE_STMT) + { + if (s->scope() && s->scope()->symbol() && s->scope()->symbol()->identifier()) + if (s->scope()->symbol()->identifier() == currScope) + symbs.insert(s); + } + else + { + if (IS_BY_USE(s) && s->scope() && s->scope()->symbol()->identifier() == currScope) + symbs.insert(s); + } s = s->next(); } } @@ -325,9 +334,9 @@ const set& getModuleSymbols(SgStatement *func) set symbs; getModuleSymbols(func, symbs); - //if function in contains + //if function or module in contains auto cp = func->controlParent(); - if (isSgProgHedrStmt(cp)) + if (isSgProgHedrStmt(cp) || cp->variant() == MODULE_STMT) getModuleSymbols(cp, symbs); symbolsForFunc[func->symbol()->identifier()] = symbs; diff --git a/src/Utils/version.h b/src/Utils/version.h index 611a726..2633120 100644 --- a/src/Utils/version.h +++ b/src/Utils/version.h @@ -1,3 +1,3 @@ #pragma once -#define VERSION_SPF "2415" +#define VERSION_SPF "2416"