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

Unified Diff: src/IceASanInstrumentation.cpp

Issue 2068593003: Implemented linking to a dummy ASan runtime (Closed) Base URL: https://chromium.googlesource.com/native_client/pnacl-subzero.git@master
Patch Set: Fixed szbuild.py and improved test Created 4 years, 6 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 | « src/IceASanInstrumentation.h ('k') | src/IceInstrumentation.h » ('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 45ec038f4ed91c596e7a5f9a7ee242096441973f..1cda875a3cd71922efda515f0ad72ee94963b759 100644
--- a/src/IceASanInstrumentation.cpp
+++ b/src/IceASanInstrumentation.cpp
@@ -15,7 +15,9 @@
#include "IceASanInstrumentation.h"
#include "IceBuildDefs.h"
+#include "IceCfgNode.h"
#include "IceGlobalInits.h"
+#include "IceInst.h"
#include <sstream>
@@ -109,4 +111,15 @@ ASanInstrumentation::createRz(VariableDeclarationList *List,
return Rz;
}
+void ASanInstrumentation::instrumentStart(Cfg *Func) {
+ Constant *ShadowMemInit =
+ Ctx->getConstantExternSym(Ctx->getGlobalString("__asan_init"));
+ constexpr SizeT NumArgs = 0;
+ constexpr Variable *Void = nullptr;
+ constexpr bool NoTailCall = false;
+
+ auto *Call = InstCall::create(Func, NumArgs, Void, ShadowMemInit, NoTailCall);
+ Func->getEntryNode()->getInsts().push_front(Call);
+}
+
} // end of namespace Ice
« no previous file with comments | « src/IceASanInstrumentation.h ('k') | src/IceInstrumentation.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698