diff options
author | Alexey Samsonov <samsonov@google.com> | 2013-03-14 12:13:27 +0000 |
---|---|---|
committer | Alexey Samsonov <samsonov@google.com> | 2013-03-14 12:13:27 +0000 |
commit | 7ac415b489dd3b22b0335af60d874143c9fdf63a (patch) | |
tree | 395d2f38541a36c5c51a3c9623c680c4bb82c99e /lib/Driver/Tools.cpp | |
parent | 8f0d1f053f3acadec28a2b1c0b6a714ad5a12aab (diff) |
[ASan] Make -fsanitize=address imply -fsanitize=init-order (if the latter is not explicitly disabled).
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@177061 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Driver/Tools.cpp')
-rw-r--r-- | lib/Driver/Tools.cpp | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/lib/Driver/Tools.cpp b/lib/Driver/Tools.cpp index 065ee7d719..d8c4415a7a 100644 --- a/lib/Driver/Tools.cpp +++ b/lib/Driver/Tools.cpp @@ -1483,6 +1483,8 @@ SanitizerArgs::SanitizerArgs(const Driver &D, const ArgList &Args) AsanZeroBaseShadow(false) { unsigned AllKinds = 0; // All kinds of sanitizers that were turned on // at least once (possibly, disabled further). + unsigned AllRemovedKinds = 0; // All kinds of sanitizers that were explicitly + // removed at least once. for (ArgList::const_iterator I = Args.begin(), E = Args.end(); I != E; ++I) { unsigned Add, Remove; if (!parse(D, Args, *I, Add, Remove, true)) @@ -1491,6 +1493,12 @@ SanitizerArgs::SanitizerArgs(const Driver &D, const ArgList &Args) Kind |= Add; Kind &= ~Remove; AllKinds |= Add; + AllRemovedKinds |= Remove; + } + // Assume -fsanitize=address implies -fsanitize=init-order, if the latter is + // not disabled explicitly. + if ((Kind & Address) != 0 && (AllRemovedKinds & InitOrder) == 0) { + Kind |= InitOrder; } UbsanTrapOnError = |