mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
Add Undefined Behavior sanitizer to Swift Driver (#18553)
This change allows the swift driver to link the ubsan runtime if `-sanitize=undefined` is specified. This is useful for sanitizing linked Objective-C code.
This commit is contained in:
committed by
George Karpenkov
parent
6462473696
commit
d3cc043e58
@@ -301,9 +301,13 @@ toolchains::GenericUnix::constructInvocation(const LinkJobAction &job,
|
||||
if (context.OI.SelectedSanitizers & SanitizerKind::Thread)
|
||||
addLinkSanitizerLibArgsForLinux(context.Args, Arguments, "tsan", *this);
|
||||
|
||||
if (context.OI.SelectedSanitizers & SanitizerKind::Undefined)
|
||||
addLinkSanitizerLibArgsForLinux(context.Args, Arguments, "ubsan", *this);
|
||||
|
||||
if (context.OI.SelectedSanitizers & SanitizerKind::Fuzzer)
|
||||
addLinkRuntimeLib(context.Args, Arguments,
|
||||
sanitizerRuntimeLibName("fuzzer"));
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user