From f83194359cebaaefec00f5f7502d655538fb2e66 Mon Sep 17 00:00:00 2001 From: Jakub Doka Date: Sun, 17 Nov 2024 21:35:41 +0100 Subject: [PATCH] fixed yet another off by 1 --- lang/src/son/hbvm/regalloc.rs | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/lang/src/son/hbvm/regalloc.rs b/lang/src/son/hbvm/regalloc.rs index aa47d6e5..6cb45357 100644 --- a/lang/src/son/hbvm/regalloc.rs +++ b/lang/src/son/hbvm/regalloc.rs @@ -301,11 +301,10 @@ impl HbvmBackend { let bundle_count = self.ralloc.bundles.len() + (reg_offset as usize); ( if tail { - debug_assert!(bundle_count >= reg::RET_ADDR as _); - bundle_count.saturating_sub(reg::RET_ADDR as _) - } else { assert!(bundle_count < reg::STACK_PTR as usize, "TODO: spill memory"); self.ralloc.bundles.len() + } else { + bundle_count.saturating_sub((reg::RET_ADDR - 1) as _) }, tail, )