I manipulate some bytecode by Soot, and produce some strange bytecode. Here is an example.
After I just insert a str = null;
inside am empty synchronized
block, the bytecode is:
0 new #15 <java/lang/String>
3 dup
4 invokespecial #16 <java/lang/String.<init> : ()V>
7 monitorenter
8 aconst_null
9 astore_0
10 aload_0
11 monitorexit
12 goto 20 (+8)
15 astore_1
16 aload_0
17 monitorexit
18 aload_1
19 athrow
20 return
I run this bytecode on HotSpot 11, but find it can't finish execution. Why?