From c70854e67dbd892ed7ca8b53d99f59d77dfc0845 Mon Sep 17 00:00:00 2001 From: Paul Grandperrin Date: Sat, 28 Apr 2018 09:08:25 +0200 Subject: [PATCH] remove panic handling at runtime and add proc_macro2 to example --- example/Cargo.toml | 4 +++- example/src/main.rs | 1 + src/lib.rs | 4 ++-- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/example/Cargo.toml b/example/Cargo.toml index 0a83288..f695360 100644 --- a/example/Cargo.toml +++ b/example/Cargo.toml @@ -5,4 +5,6 @@ authors = ["Paul Grandperrin "] [dependencies] honggfuzz = {path = ".."} -# arbitrary = "0.1" \ No newline at end of file +# arbitrary = "0.1" +proc-macro2 = { git = "https://github.com/alexcrichton/proc-macro2.git" } + diff --git a/example/src/main.rs b/example/src/main.rs index c909f43..d475dd5 100644 --- a/example/src/main.rs +++ b/example/src/main.rs @@ -1,4 +1,5 @@ #[macro_use] extern crate honggfuzz; +extern crate proc_macro2; fn main() { // Here you can parse `std::env::args and diff --git a/src/lib.rs b/src/lib.rs index f284f33..217bf69 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -243,7 +243,7 @@ pub fn fuzz(closure: F) where F: Fn(&[u8]) { lazy_static! { static ref PANIC_HOOK: () = { std::panic::set_hook(Box::new(|_| { - std::process::abort(); + //std::process::abort(); })) }; } @@ -273,7 +273,7 @@ pub fn fuzz(closure: F) where F: Fn(&[u8]) + std::panic::RefUnwindSafe { if did_panic { // hopefully the custom panic hook will be called before and abort the // process before the stack frames are unwinded. - std::process::abort(); + //std::process::abort(); } }