diff options
author | Paul Phillips <paulp@improving.org> | 2013-03-05 08:02:15 -0800 |
---|---|---|
committer | Paul Phillips <paulp@improving.org> | 2013-03-05 08:02:15 -0800 |
commit | 9b0dbdf4d788c0de7f9afb6c4a72c82727615ba8 (patch) | |
tree | df0adf075d5f37e61fae643592ea660bf901216c /src | |
parent | 1a84c86ce400d0a80065fa8d23a9506dc19e92f0 (diff) | |
parent | 387fbf459efe5bb89f3d7a76c819f72b8f8fd58f (diff) | |
download | scala-9b0dbdf4d788c0de7f9afb6c4a72c82727615ba8.tar.gz scala-9b0dbdf4d788c0de7f9afb6c4a72c82727615ba8.tar.bz2 scala-9b0dbdf4d788c0de7f9afb6c4a72c82727615ba8.zip |
Merge pull request #2175 from retronym/ticket/7185
SI-7185 Avoid NPE in TreeInfo.isExprSafeToInline
Diffstat (limited to 'src')
-rw-r--r-- | src/reflect/scala/reflect/internal/TreeInfo.scala | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/reflect/scala/reflect/internal/TreeInfo.scala b/src/reflect/scala/reflect/internal/TreeInfo.scala index 3040486076..3e74b5d22d 100644 --- a/src/reflect/scala/reflect/internal/TreeInfo.scala +++ b/src/reflect/scala/reflect/internal/TreeInfo.scala @@ -98,7 +98,8 @@ abstract class TreeInfo { // However, before typing, applications of nullary functional values are also // Apply(function, Nil) trees. To prevent them from being treated as pure, // we check that the callee is a method. - fn.symbol.isMethod && !fn.symbol.isLazy && isExprSafeToInline(fn) + // The callee might also be a Block, which has a null symbol, so we guard against that (SI-7185) + fn.symbol != null && fn.symbol.isMethod && !fn.symbol.isLazy && isExprSafeToInline(fn) case Typed(expr, _) => isExprSafeToInline(expr) case Block(stats, expr) => |