fixed getInterfaceBlock

This commit is contained in:
ALEXks
2025-04-30 16:52:37 +03:00
committed by Egor Mayorov
parent 794e2daded
commit 01b376a2bf
4 changed files with 10 additions and 8 deletions

View File

@@ -834,19 +834,21 @@ static string getInterfaceBlock(SgStatement* func, const FuncParam& pars)
auto copy = duplicateProcedure(func, NULL, false, false, false, true); auto copy = duplicateProcedure(func, NULL, false, false, false, true);
const set<string> idents(pars.identificators.begin(), pars.identificators.end()); const set<string> idents(pars.identificators.begin(), pars.identificators.end());
bool need = (func->symbol()->identifier() == string("bl182"));
//remove all exec //remove all exec
SgStatement* st = copy->lexNext(); SgStatement* st = copy->lexNext();
SgStatement* last = copy->lastNodeOfStmt(); SgStatement* last = copy->lastNodeOfStmt();
vector<SgStatement*> toExtract; vector<SgStatement*> toExtract;
while (st != last) while (st != last)
{ {
if (isDVM_stat(st) || isSPF_stat(st)) if (isDVM_stat(st) || isSPF_stat(st))
{ {
if (st->variant() != ACC_ROUTINE_DIR) if (st->variant() != ACC_ROUTINE_DIR)
{ {
SgStatement* next = st->lexNext(); toExtract.push_back(st);
st->extractStmt(); st = st->lexNext();
st = next;
} }
else else
st = st->lexNext(); st = st->lexNext();
@@ -868,6 +870,7 @@ static string getInterfaceBlock(SgStatement* func, const FuncParam& pars)
while (st != last) while (st != last)
{ {
const int var = st->variant(); const int var = st->variant();
if (var == VAR_DECL if (var == VAR_DECL
|| var == VAR_DECL_90 || var == VAR_DECL_90
|| var == DIM_STAT || var == DIM_STAT
@@ -877,9 +880,8 @@ static string getInterfaceBlock(SgStatement* func, const FuncParam& pars)
bool empty = filterFromList(st, idents); bool empty = filterFromList(st, idents);
if (empty) if (empty)
{ {
SgStatement* next = st->lexNext();
toExtract.push_back(st); toExtract.push_back(st);
st = next; st = st->lexNext();
continue; continue;
} }
} }

View File

@@ -1,3 +1,3 @@
#pragma once #pragma once
#define VERSION_SPF "2413" #define VERSION_SPF "2414"