Enum evmil::Value

source ·
pub enum Value {
    Known(usize),
    Unknown,
}
Expand description

An abstract value is either a known constant, or an unknown (i.e. arbitrary value).

Variants§

§

Known(usize)

§

Unknown

Implementations§

Examples found in repository?
src/cfa.rs (line 187)
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
    fn merge(&mut self, other: Self) -> bool {
        if self.is_bottom() {
            if !other.is_bottom() {
                *self = other;
                return true;
            }
        } else if !other.is_bottom() {
            if self.stack != other.stack {
                let s_len = self.stack.as_ref().unwrap().len();
                let o_len = other.stack.as_ref().unwrap().len();
                // Determine height of new stack
                let m = cmp::min(s_len,o_len);
                // Construct a new stack
                let mut nstack = Vec::new();
                // Perform stack merge
                for i in (0..m).rev() {
                    let l = self.peek(i);
                    let r = other.peek(i);
                    nstack.push(l.merge(r));
                }
                // Update me
                *self = CfaState{stack:Some(nstack)}
            }
        }
        //
        false
    }

Trait Implementations§

Returns a copy of the value. Read more
Performs copy-assignment from source. Read more
Formats the value using the given formatter. Read more
Formats the value using the given formatter. Read more
This method tests for self and other values to be equal, and is used by ==.
This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.

Auto Trait Implementations§

Blanket Implementations§

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The resulting type after obtaining ownership.
Creates owned data from borrowed data, usually by cloning. Read more
Uses borrowed data to replace owned data, usually by cloning. Read more
Converts the given value to a String. Read more
The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.