MCPcopy Create free account
hub / github.com/csmith-project/csmith / is_valid_ptr

Method is_valid_ptr

src/FactPointTo.cpp:434–442  ·  view source on GitHub ↗

* return true if ptr is either null nore dangling in the given context * tell the analyzer sometimes it's ok to dereference null/dead pointers */

Source from the content-addressed store, hash-verified

432 * tell the analyzer sometimes it's ok to dereference null/dead pointers
433 */
434bool
435FactPointTo::is_valid_ptr(const Variable* p, const std::vector<const Fact*>& facts)
436{
437 FactPointTo fp(p);
438 const FactPointTo* fact = (const FactPointTo*)find_related_fact(facts, &fp);
439 return fact &&
440 (CGOptions::null_pointer_dereference_prob() > 0 || !fact->is_null()) &&
441 (CGOptions::dead_pointer_dereference_prob() > 0 || !fact->is_dead());
442}
443
444/*
445 * return true if ptr is either null nore dangling in the given context

Callers

nothing calls this directly

Calls 5

find_related_factFunction · 0.85
is_nullMethod · 0.80
is_deadMethod · 0.80
sizeMethod · 0.80
get_varMethod · 0.45

Tested by

no test coverage detected