* 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 */
| 432 | * tell the analyzer sometimes it's ok to dereference null/dead pointers |
| 433 | */ |
| 434 | bool |
| 435 | FactPointTo::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 |
nothing calls this directly
no test coverage detected