Skip to content

Commit e088663

Browse files
authored
Merge pull request #70120 from hamishknight/remove-assert-5.10
2 parents bd4007f + d21d216 commit e088663

File tree

2 files changed

+12
-1
lines changed

2 files changed

+12
-1
lines changed

lib/SIL/IR/SILProfiler.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -781,7 +781,8 @@ struct CoverageMapping : public ASTWalker {
781781
/// Subtract \c Expr from \c Node's counter.
782782
void subtractFromCounter(ASTNode Node, CounterExpr Expr) {
783783
auto Counter = getCounter(Node);
784-
assert(!Counter.isZero() && "Cannot create a negative counter");
784+
// FIXME: This assertion ought to be restored (rdar://100470244)
785+
// assert(!Counter.isZero() && "Cannot create a negative counter");
785786
assignCounter(Node,
786787
CounterExpr::Sub(Counter, std::move(Expr), CounterBuilder));
787788
}

test/Profiler/rdar118896974.swift

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
// RUN: %target-swift-frontend -profile-generate -profile-coverage-mapping -emit-ir %s
2+
3+
// rdar://118896974 - Make sure we don't crash.
4+
func foo() {
5+
do {
6+
return
7+
} catch {
8+
return
9+
}
10+
}

0 commit comments

Comments
 (0)