Skip to content

Commit

Permalink
move
Browse files Browse the repository at this point in the history
  • Loading branch information
matthiaskrgr committed Mar 9, 2024
1 parent 3ff8b16 commit 5475e02
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 25 deletions.
28 changes: 26 additions & 2 deletions src/fuzz_tree_splicer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,29 @@ use rand::Rng;
use tree_sitter::{Parser, Tree};
use tree_splicer::splice::{splice, Config};

pub(crate) const IN_CODE_FP_KEYWORDS: &[&str] = &[
"panicked at",
"RUST_BACKTRACE=",
"(core dumped)",
"mir!",
"#![no_core]",
"#[rustc_symbol_name]",
"break rust",
"#[rustc_variance]",
"qemu: uncaught target signal",
"core_intrinsics", // feature(..)
"platform_intrinsics", // feature(..)
"::SIGSEGV",
"SIGSEGV::",
"span_delayed_bug_from_inside_query",
"#[rustc_variance]",
"rustc_layout_scalar_valid_range_end", // rustc attr
"rustc_attrs", // [ ]
"staged_api", // feature(..)
"lang_items", // feature(..)
"#[rustc_intrinsic]",
];

// read a file from a path and splice-fuzz it returning a set of String that we built from it
// pub(crate) fn splice_file(hm: &HashMap<String, (Vec<u8>, Tree)>) -> Vec<String> {
pub(crate) fn splice_file(path: &PathBuf) -> Vec<String> {
Expand Down Expand Up @@ -59,6 +82,7 @@ pub(crate) fn splice_file(path: &PathBuf) -> Vec<String> {
.collect::<Vec<String>>()
}

// omni
pub(crate) fn splice_file_from_set(
// path: &PathBuf,
hmap: &HashMap<String, (Vec<u8>, Tree)>,
Expand All @@ -76,9 +100,9 @@ pub(crate) fn splice_file_from_set(
let splicer_cfg: Config = Config {
inter_splices: random_inter_splices,
seed: random_seed,
tests: 30, // 10
tests: 10, // 10
//
chaos: 30, // % chance that a chaos mutation will occur
chaos: 10, // % chance that a chaos mutation will occur
deletions: 0, //
node_types: tree_splicer::node_types::NodeTypes::new(tree_sitter_rust::NODE_TYPES).unwrap(),
language: tree_sitter_rust::language(),
Expand Down
23 changes: 0 additions & 23 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1856,29 +1856,6 @@ fn find_ICE_string(
executable: &Executable,
output: Output,
) -> Option<(String, ICEKind)> {
const IN_CODE_FP_KEYWORDS: &[&str] = &[
"panicked at",
"RUST_BACKTRACE=",
"(core dumped)",
"mir!",
"#![no_core]",
"#[rustc_symbol_name]",
"break rust",
"#[rustc_variance]",
"qemu: uncaught target signal",
"core_intrinsics", // feature(..)
"platform_intrinsics", // feature(..)
"::SIGSEGV",
"SIGSEGV::",
"span_delayed_bug_from_inside_query",
"#[rustc_variance]",
"rustc_layout_scalar_valid_range_end", // rustc attr
"rustc_attrs", // [ ]
"staged_api", // feature(..)
"lang_items", // feature(..)
"#[rustc_intrinsic]",
];

let interestingness = {
let file_text: &str = &std::fs::read_to_string(input_file).unwrap_or_default();

Expand Down

0 comments on commit 5475e02

Please sign in to comment.