@@ -368,13 +368,15 @@ class ExprVisitor : public AstVisitorBase<ExprVisitor> {
368368 assert (expr->getBody () && " ClosureExpr has getBody()" );
369369 auto bodyLabel = dispatcher_.fetchLabel (expr->getBody ());
370370 dispatcher_.emit (ClosureExprsTrap{label, bodyLabel});
371+ emitAbstractClosureExpr (expr, label);
371372 }
372373
373374 void visitAutoClosureExpr (swift::AutoClosureExpr* expr) {
374375 auto label = dispatcher_.assignNewLabel (expr);
375376 assert (expr->getBody () && " AutoClosureExpr has getBody()" );
376377 auto bodyLabel = dispatcher_.fetchLabel (expr->getBody ());
377378 dispatcher_.emit (AutoClosureExprsTrap{label, bodyLabel});
379+ emitAbstractClosureExpr (expr, label);
378380 }
379381
380382 void visitCoerceExpr (swift::CoerceExpr* expr) {
@@ -534,6 +536,16 @@ class ExprVisitor : public AstVisitorBase<ExprVisitor> {
534536 }
535537
536538 private:
539+ void emitAbstractClosureExpr (swift::AbstractClosureExpr* expr,
540+ TrapLabel<AbstractClosureExprTag> label) {
541+ assert (expr->getParameters () && " AbstractClosureExpr has getParameters()" );
542+ auto params = expr->getParameters ();
543+ for (auto i = 0u ; i < params->size (); ++i) {
544+ dispatcher_.emit (
545+ AbstractClosureExprParamsTrap{label, i, dispatcher_.fetchLabel (params->get (i))});
546+ }
547+ }
548+
537549 TrapLabel<ArgumentTag> emitArgument (const swift::Argument& arg) {
538550 auto argLabel = dispatcher_.createLabel <ArgumentTag>();
539551 assert (arg.getExpr () && " Argument has getExpr" );
0 commit comments