Skip to content

Commit

Permalink
test: search harder for out-of-bounds writes
Browse files Browse the repository at this point in the history
  • Loading branch information
morrisonlevi committed May 28, 2024
1 parent 77f3f5b commit 5d6e76c
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions profiling/src/string_set.rs
Original file line number Diff line number Diff line change
Expand Up @@ -270,6 +270,12 @@ mod tests {
})
.collect();

// This could detect out-of-bounds writes.
for (thin_str, str) in thin_strs.iter().zip(wordpress_test_data::WORDPRESS_STRINGS) {
let actual = thin_str.deref();
assert_eq!(str, actual);
}

for thin_str in thin_strs.drain(..) {
unsafe { alloc.deallocate(thin_str.inline_ptr, thin_str.layout()) };
}
Expand Down

0 comments on commit 5d6e76c

Please sign in to comment.