Skip to content

Commit

Permalink
SI-9264 An even-better diagnostic for an unexplained crash
Browse files Browse the repository at this point in the history
We have seen an intermittent crasher in the backend for the last
month or so.

In scala#4397, I added a diagnostic
to show the actual locals in scope in the method.

This commit further expands the diagnistic to show the method's tree.
  • Loading branch information
retronym committed Apr 7, 2015
1 parent 214d798 commit a72eeb9
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/compiler/scala/tools/nsc/backend/icode/GenICode.scala
Original file line number Diff line number Diff line change
Expand Up @@ -883,7 +883,12 @@ abstract class GenICode extends SubComponent {
case None =>
val saved = settings.uniqid
settings.uniqid.value = true
try abort(s"symbol $sym does not exist in ${ctx.method}, which contains locals ${ctx.method.locals.mkString(",")}")
try {
val methodCode = unit.body.collect { case dd: DefDef
if dd.symbol == ctx.method.symbol => showCode(dd);
}.headOption.getOrElse("<unknown>")
abort(s"symbol $sym does not exist in ${ctx.method}, which contains locals ${ctx.method.locals.mkString(",")}. \nMethod code: $methodCode")
}
finally settings.uniqid.value = saved
}
}
Expand Down

0 comments on commit a72eeb9

Please sign in to comment.