From 9ea39d2b7c791e28461802dcb4c8f246b47ce656 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Steven=20Sch=C3=A4fer?= Date: Mon, 11 Mar 2019 13:09:17 +0100 Subject: [PATCH] Fix return types for while loops. --- .../jetbrains/kotlin/backend/jvm/codegen/ExpressionCodegen.kt | 4 ++-- compiler/testData/codegen/box/arrays/kt503.kt | 1 - .../forInIterableWithIndex/forInListWithIndexThrowsCME.kt | 1 - .../forInSequenceWithIndex/forInSequenceWithIndexThrowsCME.kt | 1 - 4 files changed, 2 insertions(+), 5 deletions(-) diff --git a/compiler/ir/backend.jvm/src/org/jetbrains/kotlin/backend/jvm/codegen/ExpressionCodegen.kt b/compiler/ir/backend.jvm/src/org/jetbrains/kotlin/backend/jvm/codegen/ExpressionCodegen.kt index c35baff6b1b..179f1629653 100644 --- a/compiler/ir/backend.jvm/src/org/jetbrains/kotlin/backend/jvm/codegen/ExpressionCodegen.kt +++ b/compiler/ir/backend.jvm/src/org/jetbrains/kotlin/backend/jvm/codegen/ExpressionCodegen.kt @@ -921,7 +921,7 @@ class ExpressionCodegen( mv.goTo(continueLabel) mv.mark(endLabel) - return loop.onStack + return StackValue.none() } override fun visitBreakContinue(jump: IrBreakContinue, data: BlockInfo): StackValue { @@ -983,7 +983,7 @@ class ExpressionCodegen( generateLoopJump(loop.condition, data, entry, false) mv.mark(endLabel) - return loop.onStack + return StackValue.none() } override fun visitTry(aTry: IrTry, data: BlockInfo): StackValue { diff --git a/compiler/testData/codegen/box/arrays/kt503.kt b/compiler/testData/codegen/box/arrays/kt503.kt index 7ff84727a8a..bf5816ddc12 100644 --- a/compiler/testData/codegen/box/arrays/kt503.kt +++ b/compiler/testData/codegen/box/arrays/kt503.kt @@ -1,4 +1,3 @@ -// IGNORE_BACKEND: JVM_IR // IGNORE_BACKEND: JS_IR // TODO: muted automatically, investigate should it be ran for JS or not // IGNORE_BACKEND: JS diff --git a/compiler/testData/codegen/box/controlStructures/forInIterableWithIndex/forInListWithIndexThrowsCME.kt b/compiler/testData/codegen/box/controlStructures/forInIterableWithIndex/forInListWithIndexThrowsCME.kt index d4b871338bc..2d8afeb4808 100644 --- a/compiler/testData/codegen/box/controlStructures/forInIterableWithIndex/forInListWithIndexThrowsCME.kt +++ b/compiler/testData/codegen/box/controlStructures/forInIterableWithIndex/forInListWithIndexThrowsCME.kt @@ -1,4 +1,3 @@ -// IGNORE_BACKEND: JVM_IR // TARGET_BACKEND: JVM // FULL_JDK // WITH_RUNTIME diff --git a/compiler/testData/codegen/box/controlStructures/forInSequenceWithIndex/forInSequenceWithIndexThrowsCME.kt b/compiler/testData/codegen/box/controlStructures/forInSequenceWithIndex/forInSequenceWithIndexThrowsCME.kt index da6c206e2fd..afcfcd510b0 100644 --- a/compiler/testData/codegen/box/controlStructures/forInSequenceWithIndex/forInSequenceWithIndexThrowsCME.kt +++ b/compiler/testData/codegen/box/controlStructures/forInSequenceWithIndex/forInSequenceWithIndexThrowsCME.kt @@ -1,4 +1,3 @@ -// IGNORE_BACKEND: JVM_IR // TARGET_BACKEND: JVM // FULL_JDK // WITH_RUNTIME