summaryrefslogtreecommitdiff
path: root/src/reflect
diff options
context:
space:
mode:
authorPaul Phillips <paulp@improving.org>2013-03-05 08:02:15 -0800
committerPaul Phillips <paulp@improving.org>2013-03-05 08:02:15 -0800
commit9b0dbdf4d788c0de7f9afb6c4a72c82727615ba8 (patch)
treedf0adf075d5f37e61fae643592ea660bf901216c /src/reflect
parent1a84c86ce400d0a80065fa8d23a9506dc19e92f0 (diff)
parent387fbf459efe5bb89f3d7a76c819f72b8f8fd58f (diff)
downloadscala-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/reflect')
-rw-r--r--src/reflect/scala/reflect/internal/TreeInfo.scala3
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) =>