[Wasm] Fix invalid boxing for non-primitive typed vararg
This commit is contained in:
+9
-1
@@ -114,7 +114,7 @@ abstract class AbstractValueUsageLowering(val context: JsCommonBackendContext) :
|
||||
if (icUtils.isTypeInlined(element.type) && !icUtils.isTypeInlined(expression.type) && !expression.type.isPrimitiveArray())
|
||||
irBuiltIns.anyNType
|
||||
else
|
||||
expression.varargElementType
|
||||
if (!expression.type.isPrimitiveArray()) irBuiltIns.anyNType else expression.varargElementType
|
||||
)
|
||||
}
|
||||
|
||||
@@ -136,6 +136,14 @@ class AutoboxingTransformer(context: JsCommonBackendContext) : AbstractValueUsag
|
||||
return res
|
||||
}
|
||||
|
||||
override fun visitFunction(declaration: IrFunction): IrStatement {
|
||||
return super.visitFunction(declaration)
|
||||
}
|
||||
|
||||
override fun visitVararg(expression: IrVararg): IrExpression {
|
||||
return super.visitVararg(expression)
|
||||
}
|
||||
|
||||
override fun IrExpression.useAsResult(enclosing: IrExpression): IrExpression {
|
||||
if (processingReturnStack.lastOrNull()?.value == enclosing && enclosing is IrReturnableBlock) {
|
||||
return useReturnableExpressionAsType(enclosing.type)
|
||||
|
||||
Reference in New Issue
Block a user