From 6430d38a6a489ba4e818b6a892e8bbbbacbfe8f3 Mon Sep 17 00:00:00 2001 From: Casey Rodarmor Date: Sat, 13 Oct 2018 21:38:44 +0800 Subject: [PATCH] Fail fuzzing on internal errors (#366) --- src/fuzzing.rs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/fuzzing.rs b/src/fuzzing.rs index ec799ee..2bd32f8 100644 --- a/src/fuzzing.rs +++ b/src/fuzzing.rs @@ -1,5 +1,9 @@ use common::*; pub fn compile(text: &str) { - Parser::parse(text).ok(); + if let Err(error) = Parser::parse(text) { + if let CompilationErrorKind::Internal{..} = error.kind { + panic!("{}", error) + } + } }