diff --git a/src/base/SMPFunction.cpp b/src/base/SMPFunction.cpp index ed9cd53bf523b4aa63fd5c19ff0c3ec4cb3ae3fc..57c0c8da2ad62152e81ef7000a8a17ae4e0f8c54 100644 --- a/src/base/SMPFunction.cpp +++ b/src/base/SMPFunction.cpp @@ -3835,15 +3835,20 @@ void SMPFunction::AnalyzeFunc(void) { CurrBlock->SetUnreachableBlock(true); SMP_msg("INFO: Marking basic block unreachable due to call 0 instruction at %llx\n", (unsigned long long) InstAddr); } - else if (STARS_BADADDR != CallTarget) { - if (INDIR_CALL == InstDataFlowType) { - this->SetHasIndirectCalls(); + else { + if (CALL == InstDataFlowType) { + bool NewDirectTarget = this->AddDirectCallTarget(CallTarget); + } + else { // INDIR_CALL + if (STARS_BADADDR == CallTarget) { + this->SetHasUnresolvedIndirectCalls(); + } + else { + bool NewIndirectTarget = this->AddIndirectCallTarget(CallTarget); + } } } - else { // STARS_BADADDR == CallTarget - - } - } + } // end if CALL or INDIR_CALL } // end for each inst CurrBlock->Analyze(); // Set up the map of instructions to basic blocks. diff --git a/src/base/SMPInstr.cpp b/src/base/SMPInstr.cpp index d708d8dece9f31e1019697f5cd0dda6417f5093f..51e7f4c8bf0ca22f87decfa5af931253fe06fa17 100644 --- a/src/base/SMPInstr.cpp +++ b/src/base/SMPInstr.cpp @@ -5366,15 +5366,10 @@ void SMPInstr::SetFixedCallJump(void) { this->RTL.GetRT(0)->SetLeftOperand(this->STARSInstPtr->MakeVoidOpnd()); if (this->type == JUMP) { this->type = CALL; // Important: Change type to CALL only after calling GetJumpTarget() - bool NewDirectTarget = this->GetBlock()->GetFunc()->AddDirectCallTarget(this->CallTarget); } else { assert(this->type == INDIR_JUMP); this->type = INDIR_CALL; - bool NewIndirectTarget = this->GetBlock()->GetFunc()->AddIndirectCallTarget(this->CallTarget); - if (STARS_BADADDR == this->CallTarget) { - this->GetBlock()->GetFunc()->SetHasUnresolvedIndirectCalls(); - } } return; } // end of SMPInstr::SetFixedCallJump()