Skip to content

Commit

Permalink
SI-4859 Retain MODULE_LOAD in dead code elim.
Browse files Browse the repository at this point in the history
Without this, the following test fails:

    SCALAC_OPTS="-optimize" ./test/partest test/files/run/t4859.scala
  • Loading branch information
retronym committed Jan 26, 2013
1 parent f21b1ce commit 412ad57
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
Expand Up @@ -144,6 +144,8 @@ abstract class DeadCodeElimination extends SubComponent {
}
}
if (necessary) worklist += ((bb, idx))
case LOAD_MODULE(sym) if isLoadNeeded(sym) =>
worklist += ((bb, idx)) // SI-4859 Module initialization might side-effect.
case _ => ()
}
rd = rdef.interpret(bb, idx, rd)
Expand Down
2 changes: 1 addition & 1 deletion test/files/run/t4859.scala
Expand Up @@ -15,7 +15,7 @@ object Outer {

object Test {
def main(args: Array[String]) {
Outer.Inner.i // we still don't initiialize Outer here (but should we?)
Outer.Inner.i // we still don't initialize Outer here (but should we?)

{println("About to reference Inner.i"); Outer}.Inner.i // Outer will be initialized.

Expand Down

0 comments on commit 412ad57

Please sign in to comment.