Update main to return the given status instead of printing the status out when halted

Signed-off-by: Alek Ratzloff <alekratz@gmail.com>
This commit is contained in:
2020-02-25 13:45:04 -05:00
parent aff2da591b
commit 1c05b3bb44

View File

@@ -36,7 +36,7 @@ fn main() -> Result<()> {
println!("{}", err.pp(&lexer, &parser::token_epp)); println!("{}", err.pp(&lexer, &parser::token_epp));
} }
if !errors.is_empty() { if !errors.is_empty() {
return Ok(()); process::exit(1);
} }
let res = res.unwrap(); let res = res.unwrap();
let mut asm = Asm::default(); let mut asm = Asm::default();
@@ -44,6 +44,6 @@ fn main() -> Result<()> {
let mut state = State::new(); let mut state = State::new();
state.load_object(object, 64 * 1024 * 1024)?; state.load_object(object, 64 * 1024 * 1024)?;
let status = state.exec()?; let status = state.exec()?;
println!("exit status: {:#04x}", status); //println!("exit status: {:#04x}", status);
Ok(()) process::exit((status & 0xffff_ffff) as i32);
} }