Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 8 additions & 9 deletions fuzzing/snmalloc-fuzzer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,6 @@ void memcpy_with_align_offset(
::operator delete(dst_, std::align_val_t{dest_alignment});
}

/*
* disable memmove tests for now
void simple_memmove(std::vector<char> data)
{
std::vector<char> dest(data.size());
Expand Down Expand Up @@ -76,7 +74,6 @@ void backward_memmove(std::string data, size_t offset)
std::string_view(to_move.data(), after_move))
abort();
}
*/

constexpr static size_t size_limit = 16384;

Expand Down Expand Up @@ -113,12 +110,17 @@ struct Result
char* ptr;
size_t size;

Result(char filler, char* ptr, size_t size) : filler(filler), ptr(ptr), size(size) {}
Result(Result&& other) noexcept : filler(other.filler), ptr(other.ptr), size(other.size)
Result(char filler, char* ptr, size_t size)
: filler(filler), ptr(ptr), size(size)
{}

Result(Result&& other) noexcept
: filler(other.filler), ptr(other.ptr), size(other.size)
{
other.ptr = nullptr;
}
Result &operator=(Result&& other) noexcept

Result& operator=(Result&& other) noexcept
{
if (this != &other)
{
Expand Down Expand Up @@ -213,12 +215,9 @@ void snmalloc_random_walk(
}

FUZZ_TEST(snmalloc_fuzzing, simple_memcpy);
/*
* disable memmove tests for now
FUZZ_TEST(snmalloc_fuzzing, simple_memmove);
FUZZ_TEST(snmalloc_fuzzing, forward_memmove);
FUZZ_TEST(snmalloc_fuzzing, backward_memmove);
*/
FUZZ_TEST(snmalloc_fuzzing, memcpy_with_align_offset)
.WithDomains(
fuzztest::InRange(0, 6),
Expand Down
Loading
Loading