From a5013b2a9dbfcc0069b513c58546596b94977ede Mon Sep 17 00:00:00 2001 From: Ivan Kalinin Date: Wed, 2 Aug 2023 00:30:28 +0200 Subject: [PATCH] Fix `pop_bool` --- src/core/stack.rs | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/core/stack.rs b/src/core/stack.rs index a6f00ac..a5633c3 100644 --- a/src/core/stack.rs +++ b/src/core/stack.rs @@ -6,7 +6,7 @@ use dyn_clone::DynClone; use everscale_types::cell::OwnedCellSlice; use everscale_types::prelude::*; use num_bigint::BigInt; -use num_traits::{One, Signed, ToPrimitive, Zero}; +use num_traits::{One, ToPrimitive, Zero}; use super::cont::*; @@ -89,8 +89,7 @@ impl Stack { } pub fn pop_bool(&mut self) -> Result { - let item = self.pop_int()?; - Ok(item.is_negative()) + Ok(!self.pop_int()?.is_zero()) } pub fn pop_smallint_range(&mut self, min: u32, max: u32) -> Result {