Don't recursively look for a symbol in all imports of imported modules.
authorIain Buclaw <ibuclaw@gdcproject.org>
Sun, 28 Feb 2016 09:25:55 +0000 (10:25 +0100)
committerIain Buclaw <ibuclaw@gdcproject.org>
Sun, 28 Feb 2016 15:11:26 +0000 (16:11 +0100)
commit38899f16e1560ce3020bab8a6a0b3a0c017d7925
tree1c6cdd7f6f0262d40d27faff8a1270809f68eb26
parente919aa9a24275a7ec59215a4e8ab93eb8e666a32
Don't recursively look for a symbol in all imports of imported modules.

Given two or more modules that import each other's scope, the current symbol
lookup routines would go round in circles looking through each import from
each module, possibly checking the same module twice or more until all possible
paths are marked as "searched".

Given enough modules, this causes an exponential slowdown in time taken to find
symbols that do exist, and infinite recursion when they don't.

gdb/ChangeLog:
* d-namespace.c (d_lookup_symbol_imports): Avoid recursive lookups from
cyclic imports.

gdb/testsuite/ChangeLog:
* gdb.dlang/circular.c: New file.
* gdb.dlang/circular.exp: New file.
gdb/ChangeLog
gdb/d-namespace.c
gdb/testsuite/ChangeLog
gdb/testsuite/gdb.dlang/circular.c [new file with mode: 0644]
gdb/testsuite/gdb.dlang/circular.exp [new file with mode: 0644]