From ed3bcba42e1ba6976d294d9da8046c63b4d59d37 Mon Sep 17 00:00:00 2001 From: Erin Date: Sun, 11 Jun 2023 15:42:53 +0200 Subject: [PATCH] a --- hbvm/src/vm/mem/mod.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hbvm/src/vm/mem/mod.rs b/hbvm/src/vm/mem/mod.rs index bad822e..28d1382 100644 --- a/hbvm/src/vm/mem/mod.rs +++ b/hbvm/src/vm/mem/mod.rs @@ -154,7 +154,7 @@ impl Memory { 2 => 1024_usize.pow(3), _ => unreachable!(), }, - offset: addr as usize & ((1 << 12) - 1), + offset: addr as usize & ((1 << (lvl * 9 + 12)) - 1), }) } }