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

Bug in regex_mutator unicode generation #19

Open
z2-2z opened this issue Aug 2, 2022 · 0 comments
Open

Bug in regex_mutator unicode generation #19

z2-2z opened this issue Aug 2, 2022 · 0 comments

Comments

@z2-2z
Copy link

z2-2z commented Aug 2, 2022

Hello,
it seems like there is a bug in the regex mutator.
If you supply the following grammar to the generator

ctx.rule("START", "{CHAR}")
ctx.regex("CHAR", ".")

it panics every other invocation in append_unicode_range():

$ ./target/release/generator -g ./demo.py -t 1
thread 'main' panicked at 'called `Option::unwrap()` on a `None` value', regex_mutator/src/lib.rs:113:45
stack backtrace:
   0: rust_begin_unwind
             at /rustc/9dd4ce80fb01d1ff5cb5002f08b7b3847b59e664/library/std/src/panicking.rs:517:5
   1: core::panicking::panic_fmt
             at /rustc/9dd4ce80fb01d1ff5cb5002f08b7b3847b59e664/library/core/src/panicking.rs:103:14
   2: core::panicking::panic
             at /rustc/9dd4ce80fb01d1ff5cb5002f08b7b3847b59e664/library/core/src/panicking.rs:50:5
   3: regex_mutator::generate
   4: grammartec::rule::Rule::generate
   5: grammartec::tree::Tree::generate_from_rule
   6: grammartec::context::Context::generate_tree_from_nt
   7: generator::main
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant