JVM IR: Don't produce CHECKCASTs on null constants (KT-36650)

This commit is contained in:
Steven Schäfer
2020-08-04 16:03:05 +02:00
committed by Alexander Udalov
parent 7503f134c2
commit 53fe30eb45
7 changed files with 26 additions and 17 deletions
@@ -12,6 +12,12 @@ suspend fun test() {
blackhole(a)
}
// jsut before suspension point
// 2 PUTFIELD .*L\$0 : Ljava/lang/Object;
// JVM_TEMPLATES:
// just before suspension point
// 1 ACONST_NULL
// 2 PUTFIELD .*L\$0 : Ljava/lang/Object;
// JVM_IR_TEMPLATES:
// two stores to initialize the `a` variable and one null constant to store in the spill slot.
// 3 ACONST_NULL