mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
Change 'switch' not to fall through between empty cases and always require at
least one statement per case rdar://16301313 Swift SVN r15266
This commit is contained in:
@@ -1818,10 +1818,10 @@ void SILGenFunction::emitSwitchStmt(SwitchStmt *S) {
|
||||
|
||||
for (auto *caseBlock : S->getCases()) {
|
||||
caseMap[caseBlock] = {};
|
||||
for (auto *label : caseBlock->getCaseLabels())
|
||||
for (auto *pattern : label->getPatterns())
|
||||
clauses.addRow(caseBlock, label->getGuardExpr(), pattern,
|
||||
CleanupsDepth::invalid(), contBB);
|
||||
for (const auto &labelItem : caseBlock->getCaseLabelItems())
|
||||
clauses.addRow(caseBlock, const_cast<Expr *>(labelItem.getGuardExpr()),
|
||||
labelItem.getPattern(),
|
||||
CleanupsDepth::invalid(), contBB);
|
||||
}
|
||||
|
||||
// Bind variable bindings from the topmost pattern nodes.
|
||||
|
||||
Reference in New Issue
Block a user