Index: src/IceInstrumentation.cpp |
diff --git a/src/IceInstrumentation.cpp b/src/IceInstrumentation.cpp |
index b4229f6da5f41edd897546636e8050bdd8a4229c..64a6212c05c05aafeeb903c09e6f59a5d5396652 100644 |
--- a/src/IceInstrumentation.cpp |
+++ b/src/IceInstrumentation.cpp |
@@ -31,12 +31,16 @@ void Instrumentation::instrumentFunc(Cfg *Func) { |
// TODO(tlively): More selectively instrument functions so that shadow memory |
// represents user accessibility more and library accessibility less. |
+ bool DidInstrumentStart = false; |
LoweringContext Context; |
Context.init(Func->getNodes().front()); |
- instrumentFuncStart(Context); |
for (CfgNode *Node : Func->getNodes()) { |
Context.init(Node); |
while (!Context.atEnd()) { |
+ if (!DidInstrumentStart) { |
+ instrumentFuncStart(Context); |
+ DidInstrumentStart = true; |
+ } |
instrumentInst(Context); |
// go to next undeleted instruction |
Context.advanceCur(); |