summaryrefslogtreecommitdiffstats
path: root/compiler-rt/lib/ubsan
diff options
context:
space:
mode:
Diffstat (limited to 'compiler-rt/lib/ubsan')
-rw-r--r--compiler-rt/lib/ubsan/ubsan_flags.cc3
-rw-r--r--compiler-rt/lib/ubsan/ubsan_flags.h1
-rw-r--r--compiler-rt/lib/ubsan/ubsan_init.cc8
3 files changed, 3 insertions, 9 deletions
diff --git a/compiler-rt/lib/ubsan/ubsan_flags.cc b/compiler-rt/lib/ubsan/ubsan_flags.cc
index 843f9a6c591..ae15fd389b1 100644
--- a/compiler-rt/lib/ubsan/ubsan_flags.cc
+++ b/compiler-rt/lib/ubsan/ubsan_flags.cc
@@ -28,7 +28,7 @@ static const char *GetRuntimeFlagsFromCompileDefinition() {
#endif
}
-void InitializeCommonFlags() {
+static void InitializeCommonFlags() {
CommonFlags *cf = common_flags();
SetCommonFlagsDefaults(cf);
cf->print_summary = false;
@@ -50,6 +50,7 @@ static void ParseFlagsFromString(Flags *f, const char *str) {
}
void InitializeFlags() {
+ InitializeCommonFlags();
Flags *f = flags();
// Default values.
f->halt_on_error = false;
diff --git a/compiler-rt/lib/ubsan/ubsan_flags.h b/compiler-rt/lib/ubsan/ubsan_flags.h
index 3b1a59e4e19..f41afbd07ac 100644
--- a/compiler-rt/lib/ubsan/ubsan_flags.h
+++ b/compiler-rt/lib/ubsan/ubsan_flags.h
@@ -23,7 +23,6 @@ struct Flags {
extern Flags ubsan_flags;
inline Flags *flags() { return &ubsan_flags; }
-void InitializeCommonFlags();
void InitializeFlags();
} // namespace __ubsan
diff --git a/compiler-rt/lib/ubsan/ubsan_init.cc b/compiler-rt/lib/ubsan/ubsan_init.cc
index 6080e304c12..2649346b1e2 100644
--- a/compiler-rt/lib/ubsan/ubsan_init.cc
+++ b/compiler-rt/lib/ubsan/ubsan_init.cc
@@ -32,15 +32,9 @@ void __ubsan::InitIfNecessary() {
if (LIKELY(ubsan_inited))
return;
if (0 == internal_strcmp(SanitizerToolName, "SanitizerTool")) {
- // WARNING: If this condition holds, then either UBSan runs in a standalone
- // mode, or initializer for another sanitizer hasn't run yet. In a latter
- // case, another sanitizer will overwrite "SanitizerToolName" and reparse
- // common flags. It means, that we are not allowed to *use* common flags
- // in this function.
+ // This will be overwritten if another sanitizer will initialize later.
SanitizerToolName = "UndefinedBehaviorSanitizer";
- InitializeCommonFlags();
}
- // Initialize UBSan-specific flags.
InitializeFlags();
SuppressionContext::InitIfNecessary();
ubsan_inited = true;
OpenPOWER on IntegriCloud