Trait cwe_checker_lib::abstract_domain::TryToBitvec
source · pub trait TryToBitvec {
// Required method
fn try_to_bitvec(&self) -> Result<Bitvector, Error>;
// Provided method
fn try_to_offset(&self) -> Result<i64, Error> { ... }
}
Expand description
A conversion trait for abstract domains that can represent register values.
Required Methods§
sourcefn try_to_bitvec(&self) -> Result<Bitvector, Error>
fn try_to_bitvec(&self) -> Result<Bitvector, Error>
If self
represents a single absolute value, return it.
In all other cases return an error.
Provided Methods§
sourcefn try_to_offset(&self) -> Result<i64, Error>
fn try_to_offset(&self) -> Result<i64, Error>
If self
represents a single absolute value, try to convert it to a signed integer and return it.
Else return an error.
Note that the conversion loses information about the bytesize of the value.