Aleph-w 7.10.0
A C++ Library for Data Structures and Algorithms
Loading...
Searching...
No Matches
fuzz_compiler_parser.cc File Reference

Fuzz recursive-descent parsing and malformed-source recovery. More...

#include <algorithm>
#include <cstddef>
#include <cstdint>
#include <cstdlib>
#include <string>
#include <Compiler_Parser.H>
Include dependency graph for fuzz_compiler_parser.cc:

Go to the source code of this file.

Functions

int LLVMFuzzerTestOneInput (const uint8_t *data, size_t size)
 Parse arbitrary bounded source text and validate the module span.
 

Detailed Description

Fuzz recursive-descent parsing and malformed-source recovery.

Definition in file fuzz_compiler_parser.cc.

Function Documentation

◆ LLVMFuzzerTestOneInput()

int LLVMFuzzerTestOneInput ( const uint8_t *  data,
size_t  size 
)

Parse arbitrary bounded source text and validate the module span.

Parameters
dataFuzzer-generated options byte followed by source text.
sizeNumber of available bytes.
Returns
Zero when parsing completes with a valid module range.
Note
Limits source text to 512 bytes to bound recursion and allocation.

Definition at line 50 of file fuzz_compiler_parser.cc.

References Aleph::Source_Manager::add_virtual_file(), Aleph::Compiler_Parser_Options::allow_top_level_statements, options, and Aleph::size().