diff --git a/src/interfaces/irdb/STARS_IRDB_Function.cpp b/src/interfaces/irdb/STARS_IRDB_Function.cpp index 68ce462d581758335e69762f2f570cd24130e037..a1c152927758b5c92be485089309f16c7619b220 100644 --- a/src/interfaces/irdb/STARS_IRDB_Function.cpp +++ b/src/interfaces/irdb/STARS_IRDB_Function.cpp @@ -227,6 +227,7 @@ void STARS_IRDB_Function_t::FindFixedCalls(SMPFunction *CurrFunc) { for (list<SMPInstr *>::iterator InstIter = CurrFunc->GetFirstInstIter(); InstIter != CurrFunc->GetLastInstIter(); ++InstIter) { SMPInstr *CurrInst = (*InstIter); + STARS_ea_t InstAddr = CurrInst->GetAddr(); if (CurrInst->IsFixedCallPush()) { FixedCallPushSeen = true; STARSOpndTypePtr PushedOpnd = CurrInst->GetPushedOpnd(); @@ -236,12 +237,19 @@ void STARS_IRDB_Function_t::FindFixedCalls(SMPFunction *CurrFunc) { if (success && (!TargetIDSet.empty())) { assert(1 == TargetIDSet.size()); FixedCallPushTargetID = TargetIDSet.begin()->GetIDWithinFile(); - if (!this->IsInstIDInFunc(FixedCallPushTargetID)) { // trying to find push of return address after fixed call + // trying to find push of return address after fixed call + // Corner case: Call could be at end of func, so pushed ID could be outside + // the func. +#if 1 + cout << "Found fixed call push at " << InstAddr << " to ID " << FixedCallPushTargetID << endl; +#else + if (!this->IsInstIDInFunc(FixedCallPushTargetID)) { FixedCallPushTargetID = STARS_BADADDR; } else { - cout << "Found fixed call push at ID " << FixedCallPushTargetID << endl; + cout << "Found fixed call push at " << InstAddr << " to ID " << FixedCallPushTargetID << endl; } +#endif } } }