mirror of
https://github.com/github/codeql.git
synced 2025-12-17 01:03:14 +01:00
Swift: remove an assert from swift headers
An interesting byproduct was finding a problematic `assert` in the Swift headers. An incomplete `FallthroughStmt` was asserting on having a destination. I did not find any other sensible way of getting rid of the crash when running in debug mode than to patch the header.
This commit is contained in:
@@ -22,6 +22,10 @@ def codeql_workspace(repository_name = "codeql"):
|
||||
_swift_prebuilt_version,
|
||||
repo_arch,
|
||||
),
|
||||
patches = [
|
||||
"@%s//swift/third_party/swift-llvm-support:patches/remove_getFallthrougDest_assert.patch" % repository_name,
|
||||
],
|
||||
patch_args = ["-p1"],
|
||||
build_file = "@%s//swift/third_party/swift-llvm-support:BUILD.swift-prebuilt.bazel" % repository_name,
|
||||
sha256 = sha256,
|
||||
)
|
||||
|
||||
11
swift/third_party/swift-llvm-support/patches/remove_getFallthrougDest_assert.patch
vendored
Normal file
11
swift/third_party/swift-llvm-support/patches/remove_getFallthrougDest_assert.patch
vendored
Normal file
@@ -0,0 +1,11 @@
|
||||
diff -ru a/include/swift/AST/Stmt.h b/include/swift/AST/Stmt.h
|
||||
--- a/include/swift/AST/Stmt.h 2022-09-21 12:56:54.000000000 +0200
|
||||
+++ b/include/swift/AST/Stmt.h 2022-11-04 14:39:18.407971007 +0100
|
||||
@@ -920,7 +920,6 @@
|
||||
/// Get the CaseStmt block to which the fallthrough transfers control.
|
||||
/// Set during Sema.
|
||||
CaseStmt *getFallthroughDest() const {
|
||||
- assert(FallthroughDest && "fallthrough dest is not set until Sema");
|
||||
return FallthroughDest;
|
||||
}
|
||||
void setFallthroughDest(CaseStmt *C) {
|
||||
Reference in New Issue
Block a user