Fix parameter indexing problem
This commit is contained in:
+6
-4
@@ -471,7 +471,8 @@ public class InterceptionInstrumenter {
|
|||||||
Type[] parameterTypes = Type.getArgumentTypes(instrumentedMethodDesc);
|
Type[] parameterTypes = Type.getArgumentTypes(instrumentedMethodDesc);
|
||||||
boolean isStatic = (instrumentedMethodAccess & ACC_STATIC) != 0;
|
boolean isStatic = (instrumentedMethodAccess & ACC_STATIC) != 0;
|
||||||
int base = isStatic ? 0 : 1;
|
int base = isStatic ? 0 : 1;
|
||||||
int parameterOffset = 0;
|
int instrumentedMethodParameterIndex = 0;
|
||||||
|
int instrumentedMethodParameterOffset = 0;
|
||||||
for (int i = 0; i < parameterCount; i++) {
|
for (int i = 0; i < parameterCount; i++) {
|
||||||
if (i == methodData.getThisParameterIndex()) {
|
if (i == methodData.getThisParameterIndex()) {
|
||||||
if (isStatic || thisUnavailable) {
|
if (isStatic || thisUnavailable) {
|
||||||
@@ -511,9 +512,10 @@ public class InterceptionInstrumenter {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
Type type = parameterTypes[parameterOffset];
|
Type type = parameterTypes[instrumentedMethodParameterIndex];
|
||||||
ia.load(base + parameterOffset, type);
|
ia.load(base + instrumentedMethodParameterOffset, type);
|
||||||
parameterOffset += type.getSize();
|
instrumentedMethodParameterIndex++;
|
||||||
|
instrumentedMethodParameterOffset += type.getSize();
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user