Skip to content

Commit

Permalink
No commit message
Browse files Browse the repository at this point in the history
  • Loading branch information
aunkrig committed Feb 21, 2020
1 parent ac886bc commit 7ef04fc
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion janino/src/main/java/org/codehaus/janino/StackMap.java
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@

import java.util.Arrays;

import org.codehaus.commons.compiler.InternalCompilerException;
import org.codehaus.commons.nullanalysis.Nullable;
import org.codehaus.janino.util.ClassFile.StackMapTableAttribute.VerificationTypeInfo;

Expand Down Expand Up @@ -89,7 +90,10 @@ class StackMap {
* @return The top element of the operand stack
*/
VerificationTypeInfo
peekOperand() { return this.operands[this.operands.length - 1]; }
peekOperand() {
if (this.operands.length == 0) throw new InternalCompilerException("Operand stack underflow");
return this.operands[this.operands.length - 1];
}

VerificationTypeInfo[]
operands() { return (VerificationTypeInfo[]) this.operands.clone(); }
Expand Down

0 comments on commit 7ef04fc

Please sign in to comment.