diff options
author | Grzegorz Kossakowski <grzegorz.kossakowski@gmail.com> | 2015-02-03 12:09:57 +0100 |
---|---|---|
committer | Grzegorz Kossakowski <grzegorz.kossakowski@gmail.com> | 2015-02-03 12:09:57 +0100 |
commit | c52083b9332e37ccd6cc82cd43928f06a24b124f (patch) | |
tree | 38cc29a7cdbb1fe03d7feaaa4d0dccf9945c4cde /src | |
parent | f79b40e08c141ae63585c5ea2fd13374bf1a0bd3 (diff) | |
parent | 41dbde91f6e68a20619c8e9247577ef0ed6d4da6 (diff) | |
download | scala-c52083b9332e37ccd6cc82cd43928f06a24b124f.tar.gz scala-c52083b9332e37ccd6cc82cd43928f06a24b124f.tar.bz2 scala-c52083b9332e37ccd6cc82cd43928f06a24b124f.zip |
Merge pull request #4292 from retronym/ticket/9133
SI-9133 Harden against infinite loop in NoSymbol.owner
Diffstat (limited to 'src')
-rw-r--r-- | src/reflect/scala/reflect/internal/Symbols.scala | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/reflect/scala/reflect/internal/Symbols.scala b/src/reflect/scala/reflect/internal/Symbols.scala index e91bfadc85..d5fc52abbf 100644 --- a/src/reflect/scala/reflect/internal/Symbols.scala +++ b/src/reflect/scala/reflect/internal/Symbols.scala @@ -2054,7 +2054,11 @@ trait Symbols extends api.Symbols { self: SymbolTable => * where it is the outer class of the enclosing class. */ final def outerClass: Symbol = - if (owner.isClass) owner + if (this == NoSymbol) { + // ideally we shouldn't get here, but its better to harden against this than suffer the infinite loop in SI-9133 + devWarningDumpStack("NoSymbol.outerClass", 15) + NoSymbol + } else if (owner.isClass) owner else if (isClassLocalToConstructor) owner.enclClass.outerClass else owner.outerClass |