Skip to content

Commit b8d4c97

Browse files
rahul-malikaciidgh
authored andcommitted
Adding Undefined Behavior Sanitizer support for C Family Languages
1 parent f12d014 commit b8d4c97

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

Sources/Build/Sanitizers.swift

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,12 +15,14 @@ import Utility
1515
public enum Sanitizer: String {
1616
case address
1717
case thread
18+
case undefined
1819

1920
/// Return an established short name for a sanitizer, e.g. "asan".
2021
public var shortName: String {
2122
switch self {
2223
case .address: return "asan"
2324
case .thread: return "tsan"
25+
case .undefined: return "ubsan"
2426
}
2527
}
2628
}
@@ -61,5 +63,6 @@ extension Sanitizer: StringEnumArgument {
6163
public static let completion: ShellCompletion = .values([
6264
(address.rawValue, "enable Address sanitizer"),
6365
(thread.rawValue, "enable Thread sanitizer"),
66+
(undefined.rawValue, "enable Undefined Behavior sanitizer")
6467
])
6568
}

0 commit comments

Comments
 (0)