Skip to content

Commit f2652e7

Browse files
committed
wip: fix unsafe seq support
1 parent 3fccf14 commit f2652e7

File tree

2 files changed

+2
-3
lines changed

2 files changed

+2
-3
lines changed

lib/AST/ASTWalker.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2101,14 +2101,13 @@ Stmt *Traversal::visitForEachStmt(ForEachStmt *S) {
21012101
return nullptr;
21022102
}
21032103

2104-
if (Stmt *Desugared= S->getDesugaredStmt()) {
2104+
if (Stmt *Desugared = S->getDesugaredStmt()) {
21052105
if ((Desugared = doIt(Desugared)))
21062106
S->setDesugaredStmt(cast<BraceStmt>(Desugared));
21072107
else
21082108
return nullptr;
21092109
}
21102110

2111-
21122111
return S;
21132112
}
21142113

lib/Sema/TypeCheckStmt.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3497,7 +3497,7 @@ static BraceStmt *desugarForEachStmt(ForEachStmt* stmt){
34973497
// expr. We need to investigate this.
34983498
// Swap in the 'unsafe' expression.
34993499
if (unsafeExpr) {
3500-
unsafeExpr->setSubExpr(makeIteratorCall);
3500+
unsafeExpr = UnsafeExpr::createImplicit(ctx, unsafeExpr->getUnsafeLoc(), makeIteratorCall);
35013501
makeIteratorCall = unsafeExpr;
35023502
}
35033503

0 commit comments

Comments
 (0)