diff --git a/hbasm/src/lib.rs b/hbasm/src/lib.rs index 73546a59..570a1667 100644 --- a/hbasm/src/lib.rs +++ b/hbasm/src/lib.rs @@ -128,7 +128,7 @@ pub fn assembly(code: &str, buf: &mut Vec) -> Result<(), Error> { } } Some(Ok(Token::Label(lbl))) => { - self.label_map.insert(lbl, self.buf.len() as u64 + 1); + self.label_map.insert(lbl, self.buf.len() as u64); } Some(Ok(Token::ISep)) => (), Some(Ok(_)) => return Err(ErrorKind::UnexpectedToken), diff --git a/hbvm/src/main.rs b/hbvm/src/main.rs index a311ff08..a136f59b 100644 --- a/hbvm/src/main.rs +++ b/hbvm/src/main.rs @@ -6,7 +6,7 @@ use { fn main() -> Result<(), Box> { let mut prog = vec![]; stdin().read_to_end(&mut prog)?; - + if let Err(e) = validate(&prog) { eprintln!("Program validation error: {e:?}"); return Ok(());