[K/N] Do not cast the result of atomicGet/atomicSet invocation from Boolean to Byte in VolatileFieldsLowering, because this cast is done by the property getter.

Merge-request: KT-MR-11347
Merged-by: Maria Sokolova <maria.sokolova@jetbrains.com>
This commit is contained in:
mvicsokolova
2023-07-28 10:14:27 +00:00
committed by Space Team
parent 5171d92fb9
commit 0521b63cb1
2 changed files with 11 additions and 0 deletions
@@ -246,6 +246,9 @@ internal class VolatileFieldsLowering(val context: Context) : FileLoweringPass {
putValueArgument(index, expression.getValueArgument(index))
}
}.let {
if (intrinsicType == IntrinsicType.ATOMIC_GET_FIELD || intrinsicType == IntrinsicType.ATOMIC_SET_FIELD) {
return it
}
if (backingField.requiresBooleanConversion()) {
for (arg in 0 until it.valueArgumentsCount) {
it.putValueArgument(arg, builder.irBoolToByte(it.getValueArgument(arg)!!))