-
Notifications
You must be signed in to change notification settings - Fork 56
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1017 from MacroModel/master
It is prohibited to directly use fast_io::string internally
- Loading branch information
Showing
6 changed files
with
98 additions
and
23 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
#include <fast_io.h> | ||
#include <fast_io_legacy.h> | ||
|
||
fast_io::filebuf_file obf( | ||
#if defined(_WIN32) && !defined(__WINE__) | ||
"nul" | ||
#else | ||
"/dev/null" | ||
#endif | ||
, | ||
fast_io::open_mode::out); | ||
|
||
|
||
extern "C" int LLVMFuzzerTestOneInput(std::uint8_t const *pptr, std::size_t n) noexcept | ||
{ | ||
char const *ptr{reinterpret_cast<char const *>(pptr)}; | ||
using namespace fast_io::mnp; | ||
::fast_io::operations::write_all(obf, ptr, ptr + n); | ||
|
||
return 0; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
#include <fast_io.h> | ||
#include <fast_io_legacy.h> | ||
|
||
fast_io::wfilebuf_file obf( | ||
#if defined(_WIN32) && !defined(__WINE__) | ||
"nul" | ||
#else | ||
"/dev/null" | ||
#endif | ||
, | ||
fast_io::open_mode::out); | ||
|
||
|
||
extern "C" int LLVMFuzzerTestOneInput(std::uint8_t const *pptr, std::size_t n) noexcept | ||
{ | ||
wchar_t const *ptr{reinterpret_cast<wchar_t const *>(pptr)}; | ||
using namespace fast_io::mnp; | ||
::fast_io::operations::write_all(obf, ptr, ptr + n / sizeof(wchar_t)); | ||
|
||
return 0; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters