Skip to content
This repository was archived by the owner on Sep 1, 2020. It is now read-only.

Commit 53a274e

Browse files
committed
Fix wrong result in InstructionStackEffect for ATHROW, RETURN
1 parent 6372c71 commit 53a274e

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/compiler/scala/tools/nsc/backend/jvm/analysis/InstructionStackEffect.scala

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -196,9 +196,9 @@ object InstructionStackEffect {
196196
LRETURN |
197197
FRETURN |
198198
DRETURN |
199-
ARETURN => (frame.getStackSize, 0)
199+
ARETURN => (1, 0) // Frame.execute consumes one stack value
200200

201-
case RETURN => (frame.getStackSize, 0)
201+
case RETURN => (0, 0) // Frame.execute does not change the stack
202202

203203
case GETSTATIC => (0, 1)
204204

@@ -229,7 +229,7 @@ object InstructionStackEffect {
229229
ANEWARRAY |
230230
ARRAYLENGTH => (1, 1)
231231

232-
case ATHROW => (frame.getStackSize, 0)
232+
case ATHROW => (1, 0) // Frame.execute consumes one stack value
233233

234234
case CHECKCAST => (0, 0)
235235

0 commit comments

Comments
 (0)