From 52dc6bada95cedf62555fddf0e673e44628d4fc5 Mon Sep 17 00:00:00 2001 From: Enkelmann Date: Tue, 5 Mar 2024 13:45:33 +0100 Subject: [PATCH] remove unnecessary panic edge cases --- src/cwe_checker_lib/src/abstract_domain/interval.rs | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/src/cwe_checker_lib/src/abstract_domain/interval.rs b/src/cwe_checker_lib/src/abstract_domain/interval.rs index b8b2e1536..bd811aa70 100644 --- a/src/cwe_checker_lib/src/abstract_domain/interval.rs +++ b/src/cwe_checker_lib/src/abstract_domain/interval.rs @@ -674,8 +674,7 @@ impl RegisterDomain for IntervalDomain { IntervalDomain::new( Bitvector::zero(width.into()), Bitvector::from_u64(self.bytesize().as_bit_length() as u64) - .into_truncate(width) - .unwrap(), + .into_zero_resize(width), ) } } @@ -693,16 +692,14 @@ impl RegisterDomain for IntervalDomain { IntervalDomain::new( Bitvector::zero(width.into()), Bitvector::from_u64(self.bytesize().as_bit_length() as u64) - .into_truncate(width) - .unwrap(), + .into_zero_resize(width), ) } } else { IntervalDomain::new( Bitvector::zero(width.into()), Bitvector::from_u64(self.bytesize().as_bit_length() as u64) - .into_truncate(width) - .unwrap(), + .into_zero_resize(width), ) } }