diff --git a/src/runtime.rs b/src/runtime.rs index 8a8e365..b39d46e 100644 --- a/src/runtime.rs +++ b/src/runtime.rs @@ -60,6 +60,10 @@ impl RunState { } pub fn from_raw(raw: &[u16]) -> Result { + if raw.len() == 0 { + exception!("provided file is empty"); + } + let orig = raw[0] as usize; if orig as usize + raw.len() > MEMORY_MAX { exception!("assembly file is too long and cannot fit in memory");