Enum cwe_checker_lib::analysis::taint::Taint
source · pub enum Taint {
Tainted(ByteSize),
Top(ByteSize),
}
Expand description
An abstract domain representing a value that is either tainted or not.
Note that the merge-function does not respect the partial order that is implied by the naming scheme of the variants! In fact, the whole analysis does not enforce any partial order for this domain. This means that in theory the fixpoint computation may not actually converge to a fixpoint, but in practice the analysis can make more precise decisions whether a value should be tainted or not.
Variants§
Tainted(ByteSize)
A tainted value of a particular bytesize.
Top(ByteSize)
An untainted value of a particular bytesize.
Implementations§
Trait Implementations§
source§impl AbstractDomain for Taint
impl AbstractDomain for Taint
source§fn merge(&self, other: &Self) -> Self
fn merge(&self, other: &Self) -> Self
The result of merging two Taint
values is tainted if at least one input was tainted.
source§fn merge_with(&mut self, other: &Self) -> &mut Self
fn merge_with(&mut self, other: &Self) -> &mut Self
Replaces self
with other
iff self
is untainted and other
is
tainted.
No change to self
is required in the other cases.
source§impl<'de> Deserialize<'de> for Taint
impl<'de> Deserialize<'de> for Taint
source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
source§impl PartialEq for Taint
impl PartialEq for Taint
source§impl RegisterDomain for Taint
impl RegisterDomain for Taint
source§fn bin_op(&self, op: BinOpType, rhs: &Self) -> Self
fn bin_op(&self, op: BinOpType, rhs: &Self) -> Self
The result of a binary operation is tainted if at least one input value was tainted.
source§fn un_op(&self, _op: UnOpType) -> Self
fn un_op(&self, _op: UnOpType) -> Self
The result of a unary operation is tainted if the input was tainted.
source§fn subpiece(&self, _low_byte: ByteSize, size: ByteSize) -> Self
fn subpiece(&self, _low_byte: ByteSize, size: ByteSize) -> Self
A subpiece of a tainted value is again tainted.
source§fn cast(&self, _kind: CastOpType, width: ByteSize) -> Self
fn cast(&self, _kind: CastOpType, width: ByteSize) -> Self
The result of a cast operation is tainted if the input was tainted.
source§impl SizedDomain for Taint
impl SizedDomain for Taint
source§impl ToJsonCompact for Taint
impl ToJsonCompact for Taint
source§fn to_json_compact(&self) -> Value
fn to_json_compact(&self) -> Value
self
that is
suitable for debugging purposes. Read moresource§fn print_compact_json(&self)
fn print_compact_json(&self)
Self
for debugging purposes.impl Copy for Taint
impl Eq for Taint
impl StructuralEq for Taint
impl StructuralPartialEq for Taint
Auto Trait Implementations§
impl RefUnwindSafe for Taint
impl Send for Taint
impl Sync for Taint
impl Unpin for Taint
impl UnwindSafe for Taint
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key
and return true
if they are equal.