Skip to content

Commit 99fafb0

Browse files
committed
split patches into multiple files and add patch.sh
1 parent 70b472e commit 99fafb0

File tree

3 files changed

+33
-12
lines changed

3 files changed

+33
-12
lines changed

patch.sh

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
#!/bin/bash
2+
3+
PATCH_DIR="$(cd "$(dirname "$0")/patches"; pwd)"
4+
5+
for patch_subdir in "$PATCH_DIR"/*; do
6+
(
7+
repo="$(basename "$patch_subdir")"
8+
cd "$repo" || exit 0
9+
echo "patching $repo"
10+
for patch in "$patch_subdir"/*; do
11+
echo " applying $(basename "$patch")"
12+
git apply "$patch"
13+
done
14+
)
15+
done
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
There are some cases when we extract bad ASTs where we hit this assertion if we compile in debug
2+
mode. This is undesirable.
3+
4+
diff --git a/include/swift/AST/Stmt.h b/include/swift/AST/Stmt.h
5+
index 532e038c386..f013eee2f98 100644
6+
--- a/include/swift/AST/Stmt.h
7+
+++ b/include/swift/AST/Stmt.h
8+
@@ -920,7 +920,6 @@ public:
9+
/// Get the CaseStmt block to which the fallthrough transfers control.
10+
/// Set during Sema.
11+
CaseStmt *getFallthroughDest() const {
12+
- assert(FallthroughDest && "fallthrough dest is not set until Sema");
13+
return FallthroughDest;
14+
}
15+
void setFallthroughDest(CaseStmt *C) {

swift-build-system.patch renamed to patches/swift/02-handle-empty-pattern-list.patch

Lines changed: 3 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,6 @@
1-
diff --git a/include/swift/AST/Stmt.h b/include/swift/AST/Stmt.h
2-
index 532e038c386..f013eee2f98 100644
3-
--- a/include/swift/AST/Stmt.h
4-
+++ b/include/swift/AST/Stmt.h
5-
@@ -920,7 +920,6 @@ public:
6-
/// Get the CaseStmt block to which the fallthrough transfers control.
7-
/// Set during Sema.
8-
CaseStmt *getFallthroughDest() const {
9-
- assert(FallthroughDest && "fallthrough dest is not set until Sema");
10-
return FallthroughDest;
11-
}
12-
void setFallthroughDest(CaseStmt *C) {
1+
`PatternBindingDecl::getPatternList()` can in some cases return an empty list, which causes a
2+
segmentation fault when getting the source range. This case needs to be handled for the extractor.
3+
134
diff --git a/lib/AST/Decl.cpp b/lib/AST/Decl.cpp
145
index 75b99a22e73..09115678a82 100644
156
--- a/lib/AST/Decl.cpp

0 commit comments

Comments
 (0)