Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fuzzgen: Always generate reachable blocks #5034

Merged
merged 9 commits into from
Oct 17, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions cranelift/codegen/src/ir/jumptable.rs
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,10 @@ impl JumpTableData {
table: Vec::with_capacity(capacity),
}
}
/// Create a new jump table with the provided blocks
pub fn with_blocks(table: Vec<Block>) -> Self {
Self { table }
}

/// Get the number of table entries.
pub fn len(&self) -> usize {
Expand Down
6 changes: 1 addition & 5 deletions cranelift/fuzzgen/src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,7 @@ pub struct Config {
/// This value does not apply to block0 which takes the function params
/// and is thus governed by `signature_params`
pub block_signature_params: RangeInclusive<usize>,
/// Max number of jump tables generated per function
/// Note, the actual number of jump tables may be larger if the Switch interface
/// decides to insert more.
pub jump_tables_per_function: RangeInclusive<usize>,
/// Max number of jump tables entries to generate
pub jump_table_entries: RangeInclusive<usize>,

/// The Switch API specializes either individual blocks or contiguous ranges.
Expand Down Expand Up @@ -66,7 +63,6 @@ impl Default for Config {
vars_per_function: 0..=16,
blocks_per_function: 0..=16,
block_signature_params: 0..=16,
jump_tables_per_function: 0..=4,
jump_table_entries: 0..=16,
switch_cases: 0..=64,
// Ranges smaller than 2 don't make sense.
Expand Down
Loading