Commit ea96185a authored by Yudi Zheng's avatar Yudi Zheng
Browse files

BugFixed:

	thisValue returns null when this not initialized.
	getReceiver with CALLSITE_ARGS now loads the correct local slot.
parent 172b3b53
......@@ -197,11 +197,16 @@ public class WeavingCode {
if (invoke.name.equals("thisValue")) {
if ((method.access & Opcodes.ACC_STATIC) == 0) {
if ((method.access & Opcodes.ACC_STATIC) != 0) {
iList.insert(instr, new InsnNode(Opcodes.ACONST_NULL));
} else if (method.name.equals("<init>")
&& AsmHelper.before(weavingLocation,
AsmHelper.findFirstValidMark(method))) {
// TODO warn user that fetching object before initialization will violate the verifying
iList.insert(instr, new InsnNode(Opcodes.ACONST_NULL));
} else {
iList.insert(instr, new VarInsnNode(Opcodes.ALOAD,
-method.maxLocals));
} else {
iList.insert(instr, new InsnNode(Opcodes.ACONST_NULL));
}
iList.remove(invoke);
......@@ -663,7 +668,7 @@ public class WeavingCode {
}
iList.insert(instr, new VarInsnNode(Opcodes.ALOAD,
method.maxLocals + maxLocals));
maxLocals));
maxLocals++;
}
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment