Skip to content

Commit

Permalink
fix: Warn when multianewarray has a zero-dimension arg
Browse files Browse the repository at this point in the history
  • Loading branch information
Col-E committed Aug 14, 2024
1 parent 2c61fd3 commit 06e5b2c
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,10 @@ public void execute(AllocateInstruction instruction) {

@Override
public void execute(AllocateMultiDimArrayInstruction instruction) {
frame.pop(instruction.dimensions()); // pop n values off the stack that fill in the dimension sizes
int dimensions = instruction.dimensions();
if (dimensions <= 0)
warn(instruction, "multianewarray must have > 0 dimensions");
frame.pop(dimensions); // pop n values off the stack that fill in the dimension sizes
frame.pushType(instruction.type());
}

Expand Down

0 comments on commit 06e5b2c

Please sign in to comment.