Skip to content
Snippets Groups Projects
Commit 5bf5c8ff authored by whh8b's avatar whh8b
Browse files

Calculate the dollop WCS correctly

Previous code calculated the dollop based on
the comprising instructions' fallthrough. This
is incorrect in the case where a dollop stops
short (because it was split during placement,
ran through an IBT, etc).
parent dfd6b36c
No related branches found
No related tags found
No related merge requests found
......@@ -31,30 +31,14 @@ namespace Zipr_SDK {
size_t Dollop_t::CalculateWorstCaseSize()
{
size_t dollop_size = 0;
Instruction_t *cur_insn = NULL;
if (front())
cur_insn = front()->Instruction();
list<DollopEntry_t*>::const_iterator it, it_end;
while (cur_insn != NULL)
for (it = begin(), it_end = end();
it != it_end;
it++)
{
/*
* TODO: Take into consideration the dollop might
* be MUCH shorter if it is going to jump to a
* previously placed dollop at this insn.
*/
#if 0
if ((to_addr=final_insn_locations[cur_insn]) != 0)
{
if (!m_replop)
{
if (m_verbose)
printf("Fallthrough loop detected. ");
break;
}
}
#endif
Instruction_t *cur_insn = (*it)->Instruction();
dollop_size += Utils::DetermineWorstCaseInsnSize(cur_insn);
cur_insn=cur_insn->GetFallthrough();
}
return dollop_size;
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment