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

Fuzz tokenization, lookahead, progress and source spans. More...

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

Go to the source code of this file.

Functions

int LLVMFuzzerTestOneInput (const uint8_t *data, size_t size)
 Tokenize arbitrary source text and validate the lexer contract.
 

Detailed Description

Fuzz tokenization, lookahead, progress and source spans.

Definition in file fuzz_compiler_lexer.cc.

Function Documentation

◆ LLVMFuzzerTestOneInput()

int LLVMFuzzerTestOneInput ( const uint8_t *  data,
size_t  size 
)

Tokenize arbitrary source text and validate the lexer contract.

Parameters
dataFuzzer-generated options byte followed by source text.
sizeNumber of available bytes.
Returns
Zero when tokenization reaches EOF with valid tokens and spans.
Note
Limits source text to 2048 bytes and token steps to source length + 1.

Definition at line 50 of file fuzz_compiler_lexer.cc.

References Aleph::Source_Manager::add_virtual_file(), Aleph::Compiler_Lexer::current_offset(), Aleph::Compiler_Lexer_Options::keep_comments, Aleph::Compiler_Lexer::next(), options, Aleph::Compiler_Lexer::peek(), and Aleph::size().