Propagate exit code in the compiler wrapper
This commit is contained in:
parent
76892fddc6
commit
abed61cc49
@ -17,8 +17,7 @@ fn main() {
|
||||
|
||||
let mut cc = ClangWrapper::new("clang", "clang++");
|
||||
|
||||
cc.is_cpp(is_cpp)
|
||||
.silence()
|
||||
if let Some(code) = cc.is_cpp(is_cpp)
|
||||
.from_args(&args)
|
||||
.unwrap()
|
||||
.link_staticlib(&dir, "fuzzbench".into())
|
||||
@ -28,7 +27,9 @@ fn main() {
|
||||
// silence the compiler wrapper output, needed for some configure scripts.
|
||||
.silence()
|
||||
.run()
|
||||
.unwrap();
|
||||
.unwrap() {
|
||||
std::process::exit(code);
|
||||
}
|
||||
} else {
|
||||
panic!("LibAFL CC: No Arguments given");
|
||||
}
|
||||
|
@ -58,7 +58,7 @@ pub trait CompilerWrapper {
|
||||
fn is_silent(&self) -> bool;
|
||||
|
||||
/// Run the compiler
|
||||
fn run(&mut self) -> Result<(), Error> {
|
||||
fn run(&mut self) -> Result<Option<i32>, Error> {
|
||||
let args = self.command()?;
|
||||
|
||||
if !self.is_silent() {
|
||||
@ -76,7 +76,7 @@ pub trait CompilerWrapper {
|
||||
if !self.is_silent() {
|
||||
dbg!(status);
|
||||
}
|
||||
Ok(())
|
||||
Ok(status.code())
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user