mirror of
https://github.com/LegacyModdingMC/UniMix.git
synced 2026-11-22 07:22:13 +00:00
Ensure CHECKCAST is added for arrays as well as objects, fixes #358
This commit is contained in:
1 parent
1dc0522559
commit
f18d8f8adf
1 file changed
+1
-1
@@ -746,7 +746,7 @@ public class CallbackInjector extends Injector {
|
||||
String accessor = CallbackInfoReturnable.getReturnAccessor(callback.target.returnType);
|
||||
String descriptor = CallbackInfoReturnable.getReturnDescriptor(callback.target.returnType);
|
||||
callback.add(new MethodInsnNode(Opcodes.INVOKEVIRTUAL, this.callbackInfoClass, accessor, descriptor, false));
|
||||
if (callback.target.returnType.getSort() == Type.OBJECT) {
|
||||
if (callback.target.returnType.getSort() >= Type.ARRAY) {
|
||||
callback.add(new TypeInsnNode(Opcodes.CHECKCAST, callback.target.returnType.getInternalName()));
|
||||
}
|
||||
callback.add(new InsnNode(callback.target.returnType.getOpcode(Opcodes.IRETURN)));
|
||||
|
||||
Reference in new issue
Block a user