Fix muzzle failure on calls to primitive array clone (#5405)
This commit is contained in:
parent
ceb36c4a17
commit
84b46cbc48
|
@ -362,6 +362,12 @@ final class ReferenceCollectingClassVisitor extends ClassVisitor {
|
||||||
? underlyingType(Type.getType(owner))
|
? underlyingType(Type.getType(owner))
|
||||||
: Type.getType("L" + owner + ";");
|
: Type.getType("L" + owner + ";");
|
||||||
|
|
||||||
|
// method invoked on a primitive array type
|
||||||
|
if (ownerType.getSort() != Type.OBJECT) {
|
||||||
|
super.visitMethodInsn(opcode, owner, name, descriptor, isInterface);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
{ // ref for method return type
|
{ // ref for method return type
|
||||||
Type returnType = underlyingType(methodType.getReturnType());
|
Type returnType = underlyingType(methodType.getReturnType());
|
||||||
if (returnType.getSort() == Type.OBJECT) {
|
if (returnType.getSort() == Type.OBJECT) {
|
||||||
|
|
|
@ -14,6 +14,7 @@ import net.bytebuddy.asm.Advice;
|
||||||
public class TestClasses {
|
public class TestClasses {
|
||||||
|
|
||||||
public static class MethodBodyAdvice {
|
public static class MethodBodyAdvice {
|
||||||
|
@SuppressWarnings("ReturnValueIgnored")
|
||||||
@Advice.OnMethodEnter
|
@Advice.OnMethodEnter
|
||||||
public static void methodBodyAdvice() {
|
public static void methodBodyAdvice() {
|
||||||
A a = new A();
|
A a = new A();
|
||||||
|
@ -24,6 +25,7 @@ public class TestClasses {
|
||||||
a.publicB.methodWithArrays(new String[0]);
|
a.publicB.methodWithArrays(new String[0]);
|
||||||
B.staticMethod();
|
B.staticMethod();
|
||||||
A.staticB.method("bar");
|
A.staticB.method("bar");
|
||||||
|
new int[0].clone();
|
||||||
}
|
}
|
||||||
|
|
||||||
public static class A {
|
public static class A {
|
||||||
|
|
Loading…
Reference in New Issue