Skip to content

Commit 88b5069

Browse files
vitalybukaAdvenamTacet
authored andcommitted
continue in SlowCopyContainerAnnotations
1 parent 50435f0 commit 88b5069

File tree

1 file changed

+9
-7
lines changed

1 file changed

+9
-7
lines changed

compiler-rt/lib/asan/asan_poisoning.cpp

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -605,13 +605,15 @@ static void SlowCopyContainerAnnotations(uptr src_beg, uptr src_end,
605605
for (; dst_ptr != end; ++dst_ptr, ++src_ptr)
606606
if (!AddressIsPoisoned(src_ptr))
607607
unpoisoned_bytes = dst_ptr - granule_beg + 1;
608-
if (dst_ptr < dst_end || dst_ptr == dst_end_down ||
609-
AddressIsPoisoned(dst_end)) {
610-
if (unpoisoned_bytes != 0 || granule_beg >= dst_beg)
611-
SetContainerGranule(granule_beg, unpoisoned_bytes);
612-
else if (!AddressIsPoisoned(dst_beg))
613-
SetContainerGranule(granule_beg, dst_beg - granule_beg);
614-
}
608+
609+
if (dst_ptr == dst_end && dst_end != dst_end_down &&
610+
!AddressIsPoisoned(dst_end))
611+
continue;
612+
613+
if (unpoisoned_bytes != 0 || granule_beg >= dst_beg)
614+
SetContainerGranule(granule_beg, unpoisoned_bytes);
615+
else if (!AddressIsPoisoned(dst_beg))
616+
SetContainerGranule(granule_beg, dst_beg - granule_beg);
615617
}
616618
}
617619

0 commit comments

Comments
 (0)