Fix processing of uninitialized instances for coroutines
The problem is that code in the attached test led to VerifyError at runtime because the Bar's uninitialized instance created in 'map' was being stored to the field (leaked from the JVM point of view). The actual problem was that after repeating visiting of NEW operation we used to drop the set of already visited copy usages. For clarification see the comment before 'processUninitializedStores' #KT-15016 Fixed
This commit is contained in:
+1
-1
@@ -160,7 +160,7 @@ private class UninitializedNewValueMarkerInterpreter : OptimizationBasicInterpre
|
||||
val uninitializedValuesToCopyUsages = hashMapOf<AbstractInsnNode, MutableSet<AbstractInsnNode>>()
|
||||
override fun newOperation(insn: AbstractInsnNode): BasicValue? {
|
||||
if (insn.opcode == Opcodes.NEW) {
|
||||
uninitializedValuesToCopyUsages[insn] = mutableSetOf()
|
||||
uninitializedValuesToCopyUsages.getOrPut(insn) { mutableSetOf() }
|
||||
return UninitializedNewValue(insn as TypeInsnNode, insn.desc)
|
||||
}
|
||||
return super.newOperation(insn)
|
||||
|
||||
Reference in New Issue
Block a user