Permalink
Browse files

Add another guard for the previous check-in for resolveImp() function

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 1af42258b8b940b8514a59dee45abb1fa3b1002b
Showing with 2 additions and 1 deletion.
  1. +2 −1 tools/flang1/flang1exe/semtbp.c
@@ -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);

0 comments on commit 1af4225

Please sign in to comment.