diff --git a/src/base/SMPFunction.cpp b/src/base/SMPFunction.cpp
index 3d413c7e58dd42b2916476cf857e7a8ff3bc0954..b0a7b3d152460ff18ebc50434ea4116346b54d6c 100644
--- a/src/base/SMPFunction.cpp
+++ b/src/base/SMPFunction.cpp
@@ -3950,6 +3950,13 @@ void SMPFunction::AnalyzeFunc(void) {
 			}
 		} // end for each inst
 		CurrBlock->Analyze();
+		// Set up the map of instructions to basic blocks.
+		for (vector<SMPInstr *>::iterator InstIter = CurrBlock->GetFirstInst(); InstIter != CurrBlock->GetLastInst(); ++InstIter) {
+			InstAddr = (*InstIter)->GetAddr();
+			pair<STARS_ea_t, SMPBasicBlock *> MapItem(InstAddr, CurrBlock);
+			this->InstBlockMap.insert(MapItem);
+		}
+
 	} // end for each block
 
 	// Set up basic block links and map of instructions to blocks.
@@ -5745,16 +5752,6 @@ void SMPFunction::SetLinks(void) {
 #if SMP_DEBUG_DATAFLOW_VERBOSE
 	SMP_msg("SetLinks called for %s\n", this->GetFuncName());
 #endif
-	// First, set up the map of instructions to basic blocks.
-	for (BlockIter = this->Blocks.begin(); BlockIter != this->Blocks.end(); ++BlockIter) {
-		CurrBlock = (*BlockIter);
-		vector<SMPInstr *>::iterator InstIter;
-		for (InstIter = CurrBlock->GetFirstInst(); InstIter != CurrBlock->GetLastInst(); ++InstIter) {
-			InstAddr = (*InstIter)->GetAddr();
-			pair<STARS_ea_t, SMPBasicBlock *> MapItem(InstAddr, CurrBlock);
-			InstBlockMap.insert(MapItem);
-		}
-	}
 
 #if SMP_DEBUG_DATAFLOW_VERBOSE
 	SMP_msg("SetLinks finished mapping: %s\n", this->GetFuncName());