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 |