- Fixed: FCoverageBuffer::InsertSpan() failed to consider the case where the new span starts above

an existing span and ends below it.

SVN r3726 (trunk)
This commit is contained in:
Randy Heit 2012-07-01 22:42:35 +00:00
parent e61f08478d
commit 8f39e692e7

View file

@ -2610,7 +2610,7 @@ void FCoverageBuffer::InsertSpan(int listnum, int start, int stop)
{ // The existing span completely covers this one. // +++++ { // The existing span completely covers this one. // +++++
return; return;
} }
// Extend the existing span with the new one. // ====== extend: // Extend the existing span with the new one. // ======
span = *span_p; // +++++++ span = *span_p; // +++++++
span->Stop = stop; // (or) +++++ span->Stop = stop; // (or) +++++
@ -2638,6 +2638,11 @@ void FCoverageBuffer::InsertSpan(int listnum, int start, int stop)
{ // The new span extends the existing span from // ++++ { // The new span extends the existing span from // ++++
// the beginning. // (or) ++++ // the beginning. // (or) ++++
(*span_p)->Start = start; (*span_p)->Start = start;
if ((*span_p)->Stop < stop)
{ // The new span also extends the existing span // ======
// at the bottom // ++++++++++++++
goto extend;
}
goto check; goto check;
} }
else // ====== else // ======