Have fuzz/* global variable names start with g_

This commit is contained in:
Nigel Tao committed 2020-03-26 14:49:43 +11:00
1 parent d60815c93f
commit f909c69deb
3 files changed
+33 -34

No files matched your search

+4 -4
View File
@@ -67,10 +67,10 @@ It should print "PASS", amongst other information, and exit(0).
#define WORK_BUFFER_ARRAY_SIZE \
WUFFS_JSON__DECODER_WORKBUF_LEN_MAX_INCL_WORST_CASE
#if WORK_BUFFER_ARRAY_SIZE > 0
uint8_t work_buffer_array[WORK_BUFFER_ARRAY_SIZE];
uint8_t g_work_buffer_array[WORK_BUFFER_ARRAY_SIZE];
#else
// Not all C/C++ compilers support 0-length arrays.
uint8_t work_buffer_array[1];
uint8_t g_work_buffer_array[1];
#endif
// Each stack element is 1 byte. The low 7 bits denote the container:
@@ -310,7 +310,7 @@ fuzz_complex(wuffs_base__io_buffer* full_src, uint32_t hash_24_bits) {
status = wuffs_json__decoder__decode_tokens(
&dec, &tok, &src,
wuffs_base__make_slice_u8(work_buffer_array, WORK_BUFFER_ARRAY_SIZE));
wuffs_base__make_slice_u8(g_work_buffer_array, WORK_BUFFER_ARRAY_SIZE));
if ((tok.data.len < tok.meta.wi) || //
(tok.meta.wi < tok.meta.ri) || //
(tok.meta.ri != old_tok_ri)) {
@@ -401,7 +401,7 @@ fuzz_simple(wuffs_base__io_buffer* full_src) {
while (true) {
status = wuffs_json__decoder__decode_tokens(
&dec, &tok, full_src,
wuffs_base__make_slice_u8(work_buffer_array, WORK_BUFFER_ARRAY_SIZE));
wuffs_base__make_slice_u8(g_work_buffer_array, WORK_BUFFER_ARRAY_SIZE));
if (status.repr == NULL) {
break;
+5 -5
View File
@@ -68,10 +68,10 @@ It should print "PASS", amongst other information, and exit(0).
#define WORK_BUFFER_ARRAY_SIZE \
WUFFS_ZLIB__DECODER_WORKBUF_LEN_MAX_INCL_WORST_CASE
#if WORK_BUFFER_ARRAY_SIZE > 0
uint8_t work_buffer_array[WORK_BUFFER_ARRAY_SIZE];
uint8_t g_work_buffer_array[WORK_BUFFER_ARRAY_SIZE];
#else
// Not all C/C++ compilers support 0-length arrays.
uint8_t work_buffer_array[1];
uint8_t g_work_buffer_array[1];
#endif
const char* //
@@ -99,9 +99,9 @@ fuzz(wuffs_base__io_buffer* src, uint32_t hash) {
while (true) {
dst.meta.wi = 0;
status =
wuffs_zlib__decoder__transform_io(&dec, &dst, src,
wuffs_base__make_slice_u8(work_buffer_array, WORK_BUFFER_ARRAY_SIZE));
status = wuffs_zlib__decoder__transform_io(
&dec, &dst, src,
wuffs_base__make_slice_u8(g_work_buffer_array, WORK_BUFFER_ARRAY_SIZE));
if (status.repr != wuffs_base__suspension__short_write) {
break;
}