fixed label handling

This commit is contained in:
Erin 2023-06-11 23:24:16 +02:00 committed by ondra05
parent 059e2b4b66
commit c7b5512ada
2 changed files with 2 additions and 2 deletions

View file

@ -128,7 +128,7 @@ pub fn assembly(code: &str, buf: &mut Vec<u8>) -> Result<(), Error> {
} }
} }
Some(Ok(Token::Label(lbl))) => { 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(Token::ISep)) => (),
Some(Ok(_)) => return Err(ErrorKind::UnexpectedToken), Some(Ok(_)) => return Err(ErrorKind::UnexpectedToken),