diff --git a/src/interfaces/irdb/STARS_IRDB_Function.cpp b/src/interfaces/irdb/STARS_IRDB_Function.cpp index 4f77a96980c156268c49d3708e91923099c77f6c..68ce462d581758335e69762f2f570cd24130e037 100644 --- a/src/interfaces/irdb/STARS_IRDB_Function.cpp +++ b/src/interfaces/irdb/STARS_IRDB_Function.cpp @@ -255,8 +255,10 @@ void STARS_IRDB_Function_t::FindFixedCalls(SMPFunction *CurrFunc) { if (success && (!TargetIDSet.empty())) { assert(1 == TargetIDSet.size()); STARS_ea_t JumpTargetID = TargetIDSet.begin()->GetIDWithinFile(); - if ((STARS_BADADDR != JumpTargetID) && (!this->IsInstIDInFunc(JumpTargetID))) { - // Valid jump target outside of current function. + bool ValidJumpTarget = (STARS_BADADDR != JumpTargetID); + bool RecursiveFixedCall = (JumpTargetID == CurrFunc->GetFirstFuncAddr()); + if (ValidJumpTarget && ((!this->IsInstIDInFunc(JumpTargetID)) || RecursiveFixedCall)) { + // Valid jump target outside of current function, or recursive call to start of function. CurrInst->SetFixedCallJump(); cout << "Found fixed call jump to ID " << JumpTargetID << " from ID " << CurrInst->GetAddr() << endl; FixedCallPushSeen = false; // reset for detection of next occurrence