Skip to content

Commit 1af4225

Browse files
committed
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.
1 parent a8ae1a0 commit 1af4225

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

tools/flang1/flang1exe/semtbp.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1360,9 +1360,10 @@ resolveImp(int dtype, tbpTask task, TBP *curr, char *impName)
13601360
IGNOREP(sym, 1);
13611361
}
13621362

1363+
scope = SCOPEG(sym);
13631364
if (!sem.which_pass && (!STYPEG(sym) ||
13641365
(!curr->isInherited && PRIVATEG(sym) && IS_PROC(STYPEG(sym)) &&
1365-
SCOPEG(SCOPEG(sym)) != stb.curr_scope))) {
1366+
scope != stb.curr_scope && SCOPEG(scope) != stb.curr_scope))) {
13661367
SPTR orig_sptr = sym;
13671368
curr->isFwdRef = 1;
13681369
sym = insert_sym(sym);

0 commit comments

Comments
 (0)