MCPcopy Index your code
hub / github.com/Rust-API/Rust-API-Bypass-Checker / value_at

Method value_at

src/analysis/abstract_domain.rs:220–243  ·  view source on GitHub ↗

Returns a reference to the value associated with the given path, if there is one.

(&self, path: &Rc<Path>)

Source from the content-addressed store, hash-verified

218
219 /// Returns a reference to the value associated with the given path, if there is one.
220 pub fn value_at(&self, path: &Rc<Path>) -> Option<Rc<SymbolicValue>> {
221 if self.numerical_domain.contains(path) {
222 let interval = self.numerical_domain.get_interval(path);
223 if let Ok(const_int) = Integer::try_from(interval) {
224 Some(SymbolicValue::make_from(
225 Expression::CompileTimeConstant(ConstantValue::Int(const_int)),
226 1,
227 ))
228 } else {
229 let e = Expression::Numerical(path.clone());
230 Some(SymbolicValue::make_from(e, 1))
231 }
232 } else if self.nullness_domain.contains(path) {
233 Some(SymbolicValue::make_from(
234 Expression::Variable {
235 path: path.clone(),
236 var_type: crate::analysis::memory::expression::ExpressionType::Reference,
237 },
238 1,
239 ))
240 } else {
241 None
242 }
243 }
244
245 /// Updates the path to value map so that the given path now points to the given value.
246 pub fn update_value_at(&mut self, path: Rc<Path>, value: Rc<SymbolicValue>) {

Callers 6

refine_pathsMethod · 0.80
refine_pathsMethod · 0.80
visit_address_ofMethod · 0.80
extract_side_effectsMethod · 0.80
import_staticMethod · 0.80

Calls 2

get_intervalMethod · 0.80
containsMethod · 0.45

Tested by

no test coverage detected