Initial stack typing

This commit is contained in:
2019-04-29 15:21:37 +02:00
parent 1381ce7b48
commit ba0fca8755
6 changed files with 106 additions and 59 deletions

View File

@@ -14,6 +14,7 @@ use Result;
use heap::Heap;
#[cfg(feature = "bonus:network")]
use netstack::NetStack;
use std::convert::TryInto;
pub const MAGIC_HEADER: u32 = 0x1DEA_DFAD;
const ANTI_BS_SIZE: usize = 0xFF;
@@ -119,7 +120,7 @@ impl Machine {
}
pub fn get_tos(&mut self) -> Result<i32> {
self.cur_stack().top()
self.cur_stack().top()?.try_into()
}
pub fn cur_frame(&mut self) -> &mut Frame {