@@ -45,9 +45,9 @@ static cpp::optional<Action> next_action() {
45
45
46
46
static cpp::optional<char *> next_cstr () {
47
47
char *result = reinterpret_cast <char *>(global_buffer);
48
- if (cpp::optional<uint64_t > len = next_uint64 ()) {
48
+ if (cpp::optional<uint8_t > len = next_u8 ()) {
49
49
uint64_t length;
50
- for (length = 0 ; length < *len % 128 ; length++) {
50
+ for (length = 0 ; length < *len; length++) {
51
51
if (length >= remaining)
52
52
return cpp::nullopt;
53
53
if (*global_buffer == ' \0 ' )
@@ -87,7 +87,7 @@ template <typename Fn> struct CleanUpHook {
87
87
#define register_cleanup (ID, ...) \
88
88
auto cleanup_hook##ID = __extension__({ \
89
89
auto a = __VA_ARGS__; \
90
- CleanUpHook<decltype (a)>{a}; \
90
+ CleanUpHook<decltype (a)>( cpp::move (a)); \
91
91
});
92
92
93
93
static void trap_with_message (const char *msg) { __builtin_trap (); }
@@ -103,8 +103,8 @@ extern "C" int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) {
103
103
memcpy (global_buffer, data, size);
104
104
105
105
remaining = size;
106
- uint64_t size_a = get_value (next_uint64) % 256 ;
107
- uint64_t size_b = get_value (next_uint64) % 256 ;
106
+ uint64_t size_a = get_value (next_u8) ;
107
+ uint64_t size_b = get_value (next_u8) ;
108
108
uint64_t rand_a = get_value (next_uint64);
109
109
uint64_t rand_b = get_value (next_uint64);
110
110
internal::HashTable *table_a = internal::HashTable::allocate (size_a, rand_a);
0 commit comments