Files
kotlin-fork/compiler/resolution
Denis Zharkov 1442dd6c2b Avoid exponential complexity in LexicalScope::findLocalVariable
There was an exponential complexity in case we have a chain
of nested LexicalScopeWrapper instances:
we were walking through the chain and on each step running
the algorithm recursively.

Such a case is possible in scripts where each line contains LexicalScopeWrapper

The fix looks safe to me because delegate was used there
for checking !is ImportingScope && !is LexicalChainedScope

In all other means, being recursively run the algorithm does the same job.

 #KT-22740 Fixed
2018-04-11 17:53:19 +03:00
..