diff options
author | Kostya Serebryany <kcc@google.com> | 2014-10-09 17:53:04 +0000 |
---|---|---|
committer | Kostya Serebryany <kcc@google.com> | 2014-10-09 17:53:04 +0000 |
commit | aed71a89bc0afae47f1f2c7b228fe2d79d2b81fe (patch) | |
tree | 837bc8d8677ea7bb4f6cc15d652744887aae64ef /clang/lib/Frontend/CompilerInvocation.cpp | |
parent | cb34fd09cd062e81c0c13d5cfa02dd8f1c44e229 (diff) | |
download | bcm5719-llvm-aed71a89bc0afae47f1f2c7b228fe2d79d2b81fe.tar.gz bcm5719-llvm-aed71a89bc0afae47f1f2c7b228fe2d79d2b81fe.zip |
Add experimental clang/driver flag -fsanitize-address-field-padding=N
Summary:
This change adds an experimental flag -fsanitize-address-field-padding=N (0, 1, 2)
to clang and driver. With this flag ASAN will be able to detect some cases of
intra-object-overflow bugs,
see https://code.google.com/p/address-sanitizer/wiki/IntraObjectOverflow
There is no actual functionality here yet, just the flag parsing.
The functionality is being reviewed at http://reviews.llvm.org/D5687
Test Plan: Build and run SPEC, LLVM Bootstrap, Chrome with this flag.
Reviewers: samsonov
Reviewed By: samsonov
Subscribers: cfe-commits
Differential Revision: http://reviews.llvm.org/D5676
llvm-svn: 219417
Diffstat (limited to 'clang/lib/Frontend/CompilerInvocation.cpp')
-rw-r--r-- | clang/lib/Frontend/CompilerInvocation.cpp | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/clang/lib/Frontend/CompilerInvocation.cpp b/clang/lib/Frontend/CompilerInvocation.cpp index 043141ad673..25d444eeb81 100644 --- a/clang/lib/Frontend/CompilerInvocation.cpp +++ b/clang/lib/Frontend/CompilerInvocation.cpp @@ -1628,6 +1628,9 @@ static void ParseLangArgs(LangOptions &Opts, ArgList &Args, InputKind IK, break; } } + // -fsanitize-address-field-padding=N has to be a LangOpt, parse it here. + Opts.Sanitize.SanitizeAddressFieldPadding = + getLastArgIntValue(Args, OPT_fsanitize_address_field_padding, 0, Diags); } static void ParsePreprocessorArgs(PreprocessorOptions &Opts, ArgList &Args, |