diff --git a/src/zipr.cpp b/src/zipr.cpp index 744f9426d9354314590d09ceefbcba22c2f404fd..2a11c05a3ace819c66187482bae1a63627603399 100644 --- a/src/zipr.cpp +++ b/src/zipr.cpp @@ -1575,6 +1575,7 @@ void ZiprImpl_t::PlaceDollops() if ((fallthrough = to_place->FallthroughDollop()) != NULL) { + size_t fallthrough_wcds = fallthrough->GetSize(); size_t fallthrough_wcis = _DetermineWorstCaseInsnSize(fallthrough-> front()-> Instruction()); @@ -1582,8 +1583,9 @@ void ZiprImpl_t::PlaceDollops() if (m_verbose) cout << "Determining whether to coalesce: " << "Remaining: " << std::dec << remaining_size - << " vs Needed: " << std::dec << fallthrough_wcis << endl; - if (remaining_size < fallthrough_wcis || fallthrough->IsPlaced()) + << " vs Needed: " << std::dec << std::min(fallthrough_wcis,fallthrough_wcds) << endl; + if ((remaining_size < fallthrough_wcis || fallthrough->IsPlaced()) && + !(remaining_size<=fallthrough_wcds)) { string patch_jump_string;