[PATCH] D12318: [ASan] Enable optional ASan recovery
Evgeniy Stepanov via llvm-commits
llvm-commits at lists.llvm.org
Tue Aug 25 11:46:52 PDT 2015
eugenis added a subscriber: eugenis.
================
Comment at: include/clang/Frontend/CodeGenOptions.def:118
@@ -117,1 +117,3 @@
///< offset in AddressSanitizer.
+CODEGENOPT(SanitizeAddressNoAbort, 1, 0) ///< Enable continue-after-error mode
+ ///< in AddressSanitizer.
----------------
Could you make it not specific to ASan? Smth like SanitizeRecover so that it could affect MSan as well in the future.
================
Comment at: lib/CodeGen/BackendUtil.cpp:343
@@ +342,3 @@
+ PMBuilder.addExtension(PassManagerBuilder::EP_OptimizerLast,
+ addAddressSanitizerNoAbortPasses);
+ PMBuilder.addExtension(PassManagerBuilder::EP_EnabledOnOptLevel0,
----------------
Why do you need separate "noabort" functions for this? See addMemorySanitizerPass which inspects CodeGenOptions in the function body.
================
Comment at: lib/Transforms/Instrumentation/AddressSanitizer.cpp:125
@@ -124,1 +124,3 @@
cl::Hidden, cl::init(false));
+static cl::opt<bool> ClEnableNoAbort(
+ "asan-noabort",
----------------
Lets stick to existing terminology (we already have "recover" and "keep-going" names for the same concept).
================
Comment at: lib/asan/asan_flags.inc:147
@@ +146,3 @@
+ "(warning: use at your own risk!)")
+ASAN_FLAG(int, num_reported_errors, 10,
+ "Maximum number of errors reported if keep_going mode is enabled")
----------------
call it max_errors, similarly to the compiler flag?
================
Comment at: lib/asan/asan_poisoning.cc:221
@@ -220,3 +220,3 @@
uptr __bad = __asan_region_is_poisoned(__p, __size); \
- __asan_report_error(pc, bp, sp, __bad, isWrite, __size, 0);\
+ __asan_report_error(pc, bp, sp, __bad, isWrite, __size, 0, false); \
} \
----------------
why "false"? Do you need to check the keep_going flag?
Repository:
rL LLVM
http://reviews.llvm.org/D12318
More information about the llvm-commits
mailing list