infix
A JIT-Powered FFI Library for C
|
Implementation of the shared recursive infix_type generator for fuzzing. More...
#include "fuzz_helpers.h"
Functions | |
infix_type * | generate_random_type (infix_arena_t *arena, fuzzer_input *in, int depth, size_t *total_fields) |
Recursively generates a randomized infix_type from the fuzzer's input data, allocating all objects from the provided arena. | |
Implementation of the shared recursive infix_type generator for fuzzing.
Copyright (c) 2025 Sanko Robinson
This source code is dual-licensed under the Artistic License 2.0 or the MIT License. You may choose to use this code under the terms of either license.
SPDX-License-Identifier: (Artistic-2.0 OR MIT)
The documentation blocks within this file are licensed under the Creative Commons Attribution 4.0 International License (CC BY 4.0).
SPDX-License-Identifier: CC-BY-4.0
This file contains the implementation of the generate_random_type
function, which is the core of the fuzzing strategy. It is designed to be compiled and linked into multiple fuzzing harnesses, providing a consistent and powerful way to generate complex and pathological test cases for the infix library's type system and ABI logic.
infix_type * generate_random_type | ( | infix_arena_t * | arena, |
fuzzer_input * | in, | ||
int | depth, | ||
size_t * | total_fields | ||
) |
Recursively generates a randomized infix_type from the fuzzer's input data, allocating all objects from the provided arena.
arena | The arena from which all types and member arrays will be allocated. |
in | A pointer to the fuzzer input buffer. |
depth | The current recursion depth (used to prevent stack overflows). |
total_fields | [in,out] A pointer to a counter for the total fields generated. |
infix_type*
allocated within the arena, or NULL on failure.