Commit 35ef8dec authored by Eric Bruneton's avatar Eric Bruneton
Browse files

Merge branch '317942-fix-checkclassadapter-frame-output' into 'master'

Fix the formatting of reference array types in stack map frame outputs.

Closes #317942

See merge request asm/asm!316
parents 184aaa9f ac42a689
......@@ -1114,7 +1114,11 @@ public class CheckClassAdapter extends ClassVisitor {
if (name.charAt(endIndex - 1) == ';') {
endIndex--;
}
return name.substring(lastSlashIndex + 1, endIndex);
int lastBracketIndex = name.lastIndexOf('[');
if (lastBracketIndex == -1) {
return name.substring(lastSlashIndex + 1, endIndex);
}
return name.substring(0, lastBracketIndex + 1) + name.substring(lastSlashIndex + 1, endIndex);
}
}
}
......@@ -549,6 +549,7 @@ public class CheckClassAdapterTest extends AsmTest implements Opcodes {
String log = logger.toString();
assertFalse(log.startsWith(AnalyzerException.class.getName() + ": Error at instruction"));
assertTrue(log.contains("00000 CheckClassAdapterTest : : ALOAD 0"));
assertTrue(log.contains("00001 CheckClassAdapterTest [Object : [Object : ARETURN"));
}
@Test
......@@ -578,4 +579,8 @@ public class CheckClassAdapterTest extends AsmTest implements Opcodes {
private static Attribute[] attributes() {
return new Attribute[] {new Comment(), new CodeComment()};
}
Object methodWithObjectArrayArgument(final Object[] arg) {
return arg;
}
}
Supports Markdown
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