From a368374e1d6759786c032468e54c42bcaa48fc48 Mon Sep 17 00:00:00 2001 From: Eric Bruneton Date: Thu, 11 Jan 2018 19:43:39 +0100 Subject: [PATCH] Don't mutate bsmArgs in MethodRemapper. --- .../main/java/org/objectweb/asm/commons/MethodRemapper.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/asm-commons/src/main/java/org/objectweb/asm/commons/MethodRemapper.java b/asm-commons/src/main/java/org/objectweb/asm/commons/MethodRemapper.java index 9c2badd6b..cb6ab1926 100644 --- a/asm-commons/src/main/java/org/objectweb/asm/commons/MethodRemapper.java +++ b/asm-commons/src/main/java/org/objectweb/asm/commons/MethodRemapper.java @@ -158,14 +158,15 @@ public class MethodRemapper extends MethodVisitor { @Override public void visitInvokeDynamicInsn(String name, String desc, Handle bsm, Object... bsmArgs) { + Object[] remappedBsmArgs = new Object[bsmArgs.length]; for (int i = 0; i < bsmArgs.length; i++) { - bsmArgs[i] = remapper.mapValue(bsmArgs[i]); + remappedBsmArgs[i] = remapper.mapValue(bsmArgs[i]); } super.visitInvokeDynamicInsn( remapper.mapInvokeDynamicMethodName(name, desc), remapper.mapMethodDesc(desc), (Handle) remapper.mapValue(bsm), - bsmArgs); + remappedBsmArgs); } @Override -- GitLab