Skip to content

Commit

Permalink
Add another guard for the previous check-in for resolveImp() function
Browse files Browse the repository at this point in the history
Do not overload the symbol if its scope is the same as the current
scope. That is, in the case where symbol is an interface, its scope
is its enclosing module (when the interface is defined in a
module). If the symbol is a procedure, then its scope is itself.
Therefore, also look at SCOPEG(scope) in this case.
  • Loading branch information
gklimowicz committed Sep 30, 2018
1 parent a8ae1a0 commit 1af4225
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion tools/flang1/flang1exe/semtbp.c
Original file line number Diff line number Diff line change
Expand Up @@ -1360,9 +1360,10 @@ resolveImp(int dtype, tbpTask task, TBP *curr, char *impName)
IGNOREP(sym, 1);
}

scope = SCOPEG(sym);
if (!sem.which_pass && (!STYPEG(sym) ||
(!curr->isInherited && PRIVATEG(sym) && IS_PROC(STYPEG(sym)) &&
SCOPEG(SCOPEG(sym)) != stb.curr_scope))) {
scope != stb.curr_scope && SCOPEG(scope) != stb.curr_scope))) {
SPTR orig_sptr = sym;
curr->isFwdRef = 1;
sym = insert_sym(sym);
Expand Down

0 comments on commit 1af4225

Please sign in to comment.