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

Method infer_reference_nullness

src/analysis/abstract_domain.rs:159–182  ·  view source on GitHub ↗
(&self, value: &Rc<SymbolicValue>)

Source from the content-addressed store, hash-verified

157 }
158
159 fn infer_reference_nullness(&self, value: &Rc<SymbolicValue>) -> Option<PointerNullness> {
160 match &value.expression {
161 Expression::Reference(..) => Some(PointerNullness::NonNull),
162 Expression::Variable { path, var_type }
163 if *var_type == crate::analysis::memory::expression::ExpressionType::Reference =>
164 {
165 self.nullness_domain.get(path)
166 }
167 Expression::Cast {
168 operand,
169 target_type,
170 } if *target_type == crate::analysis::memory::expression::ExpressionType::Reference => {
171 if operand.expression.is_zero() {
172 Some(PointerNullness::Null)
173 } else {
174 self.infer_reference_nullness(operand)
175 }
176 }
177 Expression::CompileTimeConstant(ConstantValue::Function(..)) => {
178 Some(PointerNullness::NonNull)
179 }
180 _ => None,
181 }
182 }
183
184 fn get_integer_operand_path(&mut self, value: &Rc<SymbolicValue>) -> Option<Rc<Path>> {
185 match &value.expression {

Callers 1

update_value_atMethod · 0.80

Calls 2

getMethod · 0.45
is_zeroMethod · 0.45

Tested by

no test coverage detected