AsanDie();
}
-void __asan_init() {
- if (asan_inited) return;
- asan_init_is_running = true;
-
- // Make sure we are not statically linked.
- AsanDoesNotSupportStaticLinkage();
-
- // flags
- const char *options = AsanGetEnv("ASAN_OPTIONS");
+static void ParseAsanOptions(const char *options) {
FLAG_malloc_context_size =
IntFlagValue(options, "malloc_context_size=", kMallocContextSize);
CHECK(FLAG_malloc_context_size <= kMallocContextSize);
FLAG_quarantine_size = IntFlagValue(options, "quarantine_size=",
(ASAN_LOW_MEMORY) ? 1UL << 24 : 1UL << 28);
+}
+
+void __asan_init() {
+ if (asan_inited) return;
+ asan_init_is_running = true;
+
+ // Make sure we are not statically linked.
+ AsanDoesNotSupportStaticLinkage();
+
+ // flags
+ const char *options = AsanGetEnv("ASAN_OPTIONS");
if (FLAG_v) {
Report("Parsed ASAN_OPTIONS: %s\n", options);
}
+ ParseAsanOptions(options);
+
if (FLAG_atexit) {
Atexit(asan_atexit);
}