Skip to content

Commit

Permalink
Fixes 1, more to come
Browse files Browse the repository at this point in the history
  • Loading branch information
AdvenamTacet committed Aug 20, 2024
1 parent 6fd0359 commit 7725910
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
3 changes: 3 additions & 0 deletions compiler-rt/lib/asan/asan_poisoning.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -606,6 +606,9 @@ void __sanitizer_move_contiguous_container_annotations(
&stack);
}

if(old_storage_beg == old_storage_end)
return;

uptr new_internal_beg = RoundUpTo(new_storage_beg, granularity);
uptr old_internal_beg = RoundUpTo(old_storage_beg, granularity);
uptr new_external_beg = RoundDownTo(new_storage_beg, granularity);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ void TestMove(size_t capacity, size_t off_old, size_t off_new,

for (int i = 0; i < 1000; i++) {
RandomPoison(old_beg, old_end);
std::deque<int> poison_states(old_beg, old_end);
std::deque<int> poison_states = GetPoisonedState(gold_beg, old_end);
__sanitizer_move_contiguous_container_annotations(old_beg, old_end, new_beg,
new_end);

Expand All @@ -93,7 +93,7 @@ void TestMove(size_t capacity, size_t off_old, size_t off_new,
for (; cur < old_end; ++cur) {
assert(!__asan_address_is_poisoned(cur));
}
// Memory after old_beg should be the same as at the beginning.
// Memory after old_end should be the same as at the beginning.
for (; cur < old_buffer_end; ++cur) {
assert(__asan_address_is_poisoned(cur) == poison_old);
}
Expand Down

0 comments on commit 7725910

Please sign in to comment.