From 085c593add6e8341daa7319d6c58fcd2e92fec31 Mon Sep 17 00:00:00 2001 From: Jakub Doka Date: Sat, 16 Nov 2024 10:03:08 +0100 Subject: [PATCH] removing needless truncation of zeroth register --- lang/src/son/hbvm.rs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lang/src/son/hbvm.rs b/lang/src/son/hbvm.rs index 3b1a0a4..3db1484 100644 --- a/lang/src/son/hbvm.rs +++ b/lang/src/son/hbvm.rs @@ -458,6 +458,10 @@ struct InstrCtx<'a> { impl HbvmBackend { fn extend(&mut self, base: ty::Id, dest: ty::Id, reg: Reg, tys: &Types, files: &[parser::Ast]) { + if reg == 0 { + return; + } + let (bsize, dsize) = (tys.size_of(base), tys.size_of(dest)); debug_assert!(bsize <= 8, "{}", ty::Display::new(tys, files, base)); debug_assert!(dsize <= 8, "{}", ty::Display::new(tys, files, dest));