Skip to content

Commit

Permalink
Fix NautilusContext::from_file for python files (AFLplusplus#2690)
Browse files Browse the repository at this point in the history
  • Loading branch information
jejuisland87654 authored and riesentoaster committed Nov 21, 2024
1 parent 02c0b03 commit 36bbdb7
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion libafl/src/generators/nautilus.rs
Original file line number Diff line number Diff line change
Expand Up @@ -89,9 +89,10 @@ impl NautilusContext {
let grammar_file = grammar_file.as_ref();
if grammar_file.extension().unwrap_or_default() == "py" {
log::debug!("Creating NautilusContext from python grammar");
let ctx = python_grammar_loader::load_python_grammar(
let mut ctx = python_grammar_loader::load_python_grammar(
fs::read_to_string(grammar_file)?.as_str(),
);
ctx.initialize(tree_depth);
return Ok(Self { ctx });
}
log::debug!("Creating NautilusContext from json grammar");
Expand Down

0 comments on commit 36bbdb7

Please sign in to comment.