joa/apparat

"Case index out of bounds" - Merging control flow

warmfusion opened this issue · 2 comments

Received the following exception during a build of a Flex application using Maven and the Flex Mojos 4.0-RC2 libraries.

I'm not sure what to do as theres not much information avaliable and reading the source code at the described stack trace points leads me to wonder if we've got some code that has just tripped over a glass ceiling or has otherwise confused/broken the integration?

[INFO] Merging identical control flow ...
[INFO] Merging ABC files ...
[INFO] Rebuilding constant pool ...
[INFO] Compression ratio: 1.59%
[INFO] Total bytes: 7956
[INFO] Merging identical control flow ...
<function0>: caught java.lang.RuntimeException: Case index out of bounds : 16
java.lang.RuntimeException: Case index out of bounds : 16
    at scala.Predef$.error(Predef.scala:58)
    at apparat.graph.ControlFlowGraphBytecodeBuilder$LookupSwitchContainer$1.addCase(ControlFlowGraphBytecodeBuilder.scala:183)
    at apparat.graph.ControlFlowGraphBytecodeBuilder$.patchLookupSwitch$1(ControlFlowGraphBytecodeBuilder.scala:205)
    at apparat.graph.ControlFlowGraphBytecodeBuilder$$anonfun$toBytecode$3$$anonfun$apply$3.apply(ControlFlowGraphBytecodeBuilder.scala:248)
    at apparat.graph.ControlFlowGraphBytecodeBuilder$$anonfun$toBytecode$3$$anonfun$apply$3.apply(ControlFlowGraphBytecodeBuilder.scala:221)
    at scala.collection.TraversableLike$WithFilter$$anonfun$foreach$1.apply(TraversableLike.scala:826)
    at scala.collection.LinearSeqOptimized$class.foreach(LinearSeqOptimized.scala:61)
    at scala.collection.immutable.List.foreach(List.scala:45)
    at scala.collection.TraversableLike$WithFilter.foreach(TraversableLike.scala:825)
    at apparat.graph.ControlFlowGraphBytecodeBuilder$$anonfun$toBytecode$3.apply(ControlFlowGraphBytecodeBuilder.scala:221)
    at apparat.graph.ControlFlowGraphBytecodeBuilder$$anonfun$toBytecode$3.apply(ControlFlowGraphBytecodeBuilder.scala:220)
    at scala.collection.LinearSeqOptimized$class.foreach(LinearSeqOptimized.scala:61)
    at scala.collection.immutable.List.foreach(List.scala:45)
    at apparat.graph.ControlFlowGraphBytecodeBuilder$.toBytecode(ControlFlowGraphBytecodeBuilder.scala:219)
    at apparat.graph.ControlFlowGraphBytecodeBuilder$.apply(ControlFlowGraphBytecodeBuilder.scala:301)
    at apparat.graph.mutable.MutableBytecodeControlFlowGraph.bytecode(MutableBytecodeControlFlowGraph.scala:91)
    at apparat.tools.reducer.Reducer$ReducerTool$$anonfun$run$3$$anonfun$apply$1$$anonfun$apply$2$$anonfun$apply$3$$anonfun$apply$4.apply(Reducer.scala:93)
    at apparat.tools.reducer.Reducer$ReducerTool$$anonfun$run$3$$anonfun$apply$1$$anonfun$apply$2$$anonfun$apply$3$$anonfun$apply$4.apply(Reducer.scala:91)
    at scala.Option.foreach(Option.scala:185)
    at apparat.tools.reducer.Reducer$ReducerTool$$anonfun$run$3$$anonfun$apply$1$$anonfun$apply$2$$anonfun$apply$3.apply(Reducer.scala:91)
    at apparat.tools.reducer.Reducer$ReducerTool$$anonfun$run$3$$anonfun$apply$1$$anonfun$apply$2$$anonfun$apply$3.apply(Reducer.scala:90)
    at scala.Option.foreach(Option.scala:185)
    at apparat.tools.reducer.Reducer$ReducerTool$$anonfun$run$3$$anonfun$apply$1$$anonfun$apply$2.apply(Reducer.scala:90)
    at apparat.tools.reducer.Reducer$ReducerTool$$anonfun$run$3$$anonfun$apply$1$$anonfun$apply$2.apply(Reducer.scala:89)
    at scala.collection.IndexedSeqOptimized$class.foreach(IndexedSeqOptimized.scala:34)
    at scala.collection.mutable.ArrayOps.foreach(ArrayOps.scala:35)
    at apparat.tools.reducer.Reducer$ReducerTool$$anonfun$run$3.apply(Reducer.scala:86)
    at apparat.tools.reducer.Reducer$ReducerTool$$anonfun$run$3.apply(Reducer.scala:84)
    at apparat.swf.SwfTagMapping$$anonfun$2$$anonfun$apply$1.apply(SwfTagMapping.scala:41)
    at apparat.swf.SwfTagMapping$$anonfun$2$$anonfun$apply$1.apply(SwfTagMapping.scala:41)
    at scala.actors.Futures$$anonfun$1.apply(Future.scala:128)
    at scala.actors.Futures$$anonfun$1.apply(Future.scala:128)
    at scala.actors.FutureActor$$anonfun$act$1.apply(Future.scala:94)
    at scala.actors.FutureActor$$anonfun$act$1.apply(Future.scala:94)
    at scala.actors.Reactor$class.seq(Reactor.scala:280)
    at scala.actors.FutureActor.seq(Future.scala:56)
    at scala.actors.Reactor$$anon$3.andThen(Reactor.scala:258)
    at scala.actors.FutureActor.act(Future.scala:95)
    at scala.actors.Reactor$$anonfun$dostart$1.apply(Reactor.scala:222)
    at scala.actors.Reactor$$anonfun$dostart$1.apply(Reactor.scala:222)
    at scala.actors.ReactorTask.run(ReactorTask.scala:36)
    at scala.actors.threadpool.ThreadPoolExecutor.runWorker(Unknown Source)
    at scala.actors.threadpool.ThreadPoolExecutor$Worker.run(Unknown Source)
    at java.lang.Thread.run(Thread.java:724)

Did you ever find out what the issue was here? I know this is old, but I'm just running into this now..

I'm afraid not. I believe we gave up and stopped using Flex entirely. No idea if this bug remains, and as the code hasn't been touched in 5 years i'm closing the issue.