Reported by Levente.Santha, Jan 11, 2009
The bug was described in detail in this thread: http:group/clojure/browse_thread/thread/81ba15d7e9130441
For clojure.core$last__2954.invoke the correct bytecode would be (notice
the removed "goto 65" after "41: goto 0"):
public java.lang.Object invoke(java.lang.Object) throws
java.lang.Exception;
Code:
0: getstatic #22; 3: invokevirtual #37; Object;
6: checkcast #39; 9: aload_1
10: invokeinterface #41, 2; (Ljava/lang/Object;)Ljava/lang/Object;
15: dup
16: ifnull 44
19: getstatic #47; Boolean;
22: if_acmpeq 45
25: getstatic #22; 28: invokevirtual #37; Object;
31: checkcast #39; 34: aload_1
35: invokeinterface #41, 2; (Ljava/lang/Object;)Ljava/lang/Object;
40: astore_1
41: goto 0
44: pop
45: getstatic #26; 48: invokevirtual #37; Object;
51: checkcast #39; 54: aload_1
55: aconst_null
56: astore_1
57: invokeinterface #41, 2; (Ljava/lang/Object;)Ljava/lang/Object;
62: areturn
Our JIT reported incorrect stack size along the basic block introduced by
the unneeded goto.
The bug was present in SVN rev 1205.