Fixed a logic bug in the memory overlap check function
This commit is contained in:
parent
cd6d0773b3
commit
c8ae7a57d1
|
@ -14,10 +14,12 @@ bool_t rr_mem_overlap(void *block1, usz_t length1, void *block2, usz_t length2)
|
||||||
}
|
}
|
||||||
usz_t start1 = (usz_t) block1;
|
usz_t start1 = (usz_t) block1;
|
||||||
usz_t start2 = (usz_t) block2;
|
usz_t start2 = (usz_t) block2;
|
||||||
|
usz_t end1 = start1 + length1;
|
||||||
usz_t end2 = start2 + length2;
|
usz_t end2 = start2 + length2;
|
||||||
|
|
||||||
if(end2 > start1)
|
if(end2 > start1)
|
||||||
{
|
{
|
||||||
|
if(start2 > end1) return FALSE;
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
|
Loading…
Reference in New Issue