Do not generate ACONST_NULL as continuation of crossinline suspend lambda
This commit is contained in:
@@ -1103,7 +1103,11 @@ public class ExpressionCodegen extends KtVisitor<StackValue, StackValue> impleme
|
||||
if (closure.isSuspend()) {
|
||||
// resultContinuation
|
||||
if (closure.isSuspendLambda()) {
|
||||
v.aconst(null);
|
||||
boolean isCrossinlineLambda = (callGenerator instanceof InlineCodegen<?>) &&
|
||||
Objects.requireNonNull(((InlineCodegen) callGenerator).getActiveLambda()).isCrossInline;
|
||||
if (!isCrossinlineLambda) {
|
||||
v.aconst(null);
|
||||
}
|
||||
}
|
||||
else {
|
||||
assert context.getFunctionDescriptor().isSuspend() : "Coroutines closure must be created only inside suspend functions";
|
||||
|
||||
@@ -87,7 +87,7 @@ abstract class InlineCodegen<out T: BaseExpressionCodegen>(
|
||||
|
||||
protected val expressionMap = linkedMapOf<Int, LambdaInfo>()
|
||||
|
||||
protected var activeLambda: LambdaInfo? = null
|
||||
var activeLambda: LambdaInfo? = null; protected set
|
||||
|
||||
private val defaultSourceMapper = sourceCompiler.lazySourceMapper
|
||||
|
||||
|
||||
Reference in New Issue
Block a user