fix: keep all dimensions for anewarray of an array element type (PR #2887)

This commit is contained in:
Ananya
2026-06-14 22:50:06 +02:00
committed by GitHub
parent 8c28a8530e
commit 9d4babcdce
3 changed files with 45 additions and 12 deletions
@@ -342,7 +342,9 @@ public class JavaInsnsRegister {
s.idx(s.u2());
int dim = s.u1();
JavaInsnData insn = s.insn();
insn.setLiteral(dim);
// operand is already the full array type (like new-array): literal 0 = no wrapping; the
// dimension count is carried by regsCount
insn.setLiteral(0);
insn.setRegsCount(dim + 1);
for (int i = dim; i > 0; i--) {
s.pop(i);