Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(4)

Unified Diff: src/IceASanInstrumentation.cpp

Issue 2145063003: Updates in preparation of wrapper script (Closed) Base URL: https://chromium.googlesource.com/native_client/pnacl-subzero.git@master
Patch Set: minor fix to test Created 4 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « runtime/szrt_asan.c ('k') | tests_lit/asan_tests/func_ptr.ll » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/IceASanInstrumentation.cpp
diff --git a/src/IceASanInstrumentation.cpp b/src/IceASanInstrumentation.cpp
index 6374ce8c6be698df64b00713c460f42215153b29..a02cb6e006f4f0b32613e7652fef30a91ac83e6e 100644
--- a/src/IceASanInstrumentation.cpp
+++ b/src/IceASanInstrumentation.cpp
@@ -31,6 +31,7 @@ namespace Ice {
namespace {
+constexpr const char *ASanPrefix = "__asan";
constexpr SizeT RzSize = 32;
constexpr const char *RzPrefix = "__$rz";
constexpr const char *RzArrayName = "__$rz_array";
@@ -44,7 +45,9 @@ using string_map = std::unordered_map<std::string, std::string>;
using string_set = std::unordered_set<std::string>;
// TODO(tlively): Handle all allocation functions
const string_map FuncSubstitutions = {{"malloc", "__asan_malloc"},
- {"free", "__asan_free"}};
+ {"free", "__asan_free"},
+ {"calloc", "__asan_calloc"},
+ {"__asan_dummy_calloc", "__asan_calloc"}};
const string_set FuncBlackList = {"_Balloc"};
llvm::NaClBitcodeRecord::RecordVector sizeToByteVec(SizeT Size) {
@@ -63,7 +66,8 @@ ICE_TLS_DEFINE_FIELD(std::vector<InstCall *> *, ASanInstrumentation,
bool ASanInstrumentation::isInstrumentable(Cfg *Func) {
std::string FuncName = Func->getFunctionName().toStringOrEmpty();
- return FuncName == "" || FuncBlackList.count(FuncName) == 0;
+ return FuncName == "" ||
+ (FuncBlackList.count(FuncName) == 0 && FuncName.find(ASanPrefix) != 0);
}
// Create redzones around all global variables, ensuring that the initializer
« no previous file with comments | « runtime/szrt_asan.c ('k') | tests_lit/asan_tests/func_ptr.ll » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698