From 2144c055d11b9cf606aed620b6100a7475cd42e4 Mon Sep 17 00:00:00 2001 From: Erin Date: Sat, 10 Jun 2023 16:46:04 +0200 Subject: [PATCH] added safety notice --- hbvm/src/main.rs | 2 +- hbvm/src/vm/mod.rs | 6 +++++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/hbvm/src/main.rs b/hbvm/src/main.rs index 3eac6c7..a311ff0 100644 --- a/hbvm/src/main.rs +++ b/hbvm/src/main.rs @@ -1,5 +1,5 @@ use { - hbvm::{validate::validate, vm::Vm, RuntimeErrors}, + hbvm::{validate::validate, vm::Vm}, std::io::{stdin, Read}, }; diff --git a/hbvm/src/vm/mod.rs b/hbvm/src/vm/mod.rs index 93b1bdf..1798b4e 100644 --- a/hbvm/src/vm/mod.rs +++ b/hbvm/src/vm/mod.rs @@ -4,8 +4,12 @@ // # General safety notice: // - Validation has to assure there is 60 registers (r0 - r59) -// - Instructions has to be valid as specified (values and sizes) +// - Instructions have to be valid as specified (values and sizes) // - Mapped pages should be at least 8 KiB +// - Yes, I am aware of the UB when jumping in-mid of instruction where +// the read byte corresponds to an instruction whose lenght exceets the +// program size. If you are (rightfully) worried about the UB, for now just +// append your program with 11 zeroes. mod mem; mod value;