JVM_IR: Fix stack underflow for unit coercion of when expressions.
Code such as ``` val b = getBoolean() if (b) 4 else if (b) 5 ``` didn't generate a value on the stack always and therefore would have control-flow paths leading to a pop instruction with nothing on the stack. Change-Id: I09d059f361e56a41880006e3f4e51e9acdbd167d
This commit is contained in:
+5
@@ -24519,6 +24519,11 @@ public class BlackBoxCodegenTestGenerated extends AbstractBlackBoxCodegenTest {
|
||||
runTest("compiler/testData/codegen/box/when/multipleEntries.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("noElseCoerceToUnit.kt")
|
||||
public void testNoElseCoerceToUnit() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/when/noElseCoerceToUnit.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("noElseExhaustive.kt")
|
||||
public void testNoElseExhaustive() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/when/noElseExhaustive.kt");
|
||||
|
||||
Reference in New Issue
Block a user