Skip to content

Commit 7725910

Browse files
committed
Fixes 1, more to come
1 parent 6fd0359 commit 7725910

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

compiler-rt/lib/asan/asan_poisoning.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -606,6 +606,9 @@ void __sanitizer_move_contiguous_container_annotations(
606606
&stack);
607607
}
608608

609+
if(old_storage_beg == old_storage_end)
610+
return;
611+
609612
uptr new_internal_beg = RoundUpTo(new_storage_beg, granularity);
610613
uptr old_internal_beg = RoundUpTo(old_storage_beg, granularity);
611614
uptr new_external_beg = RoundDownTo(new_storage_beg, granularity);

compiler-rt/test/asan/TestCases/move_container_annotations.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ void TestMove(size_t capacity, size_t off_old, size_t off_new,
8181

8282
for (int i = 0; i < 1000; i++) {
8383
RandomPoison(old_beg, old_end);
84-
std::deque<int> poison_states(old_beg, old_end);
84+
std::deque<int> poison_states = GetPoisonedState(gold_beg, old_end);
8585
__sanitizer_move_contiguous_container_annotations(old_beg, old_end, new_beg,
8686
new_end);
8787

@@ -93,7 +93,7 @@ void TestMove(size_t capacity, size_t off_old, size_t off_new,
9393
for (; cur < old_end; ++cur) {
9494
assert(!__asan_address_is_poisoned(cur));
9595
}
96-
// Memory after old_beg should be the same as at the beginning.
96+
// Memory after old_end should be the same as at the beginning.
9797
for (; cur < old_buffer_end; ++cur) {
9898
assert(__asan_address_is_poisoned(cur) == poison_old);
9999
}

0 commit comments

Comments
 (0)