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

Method merge_pointees_of_pointers

src/FactPointTo.cpp:718–739  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

716}
717
718std::vector<const Variable*>
719FactPointTo::merge_pointees_of_pointers(const std::vector<const Variable*>& ptrs, const std::vector<const Fact*>& facts)
720{
721 size_t i, j;
722 vector<const Variable*> pointee_vars;
723 for (i=0; i<ptrs.size(); i++) {
724 const Variable* p = ptrs[i];
725 if (FactPointTo::is_special_ptr(p)) continue;
726 FactPointTo dummy(p);
727 const FactPointTo* exist_fact = (const FactPointTo*)find_related_fact(facts, &dummy);
728 // I can not think of a reason this is null
729 // well...this actually happens when p is a parameter of function f, and we are in the middle of creating f
730 assert(exist_fact);
731 if (exist_fact) {
732 for (j=0; j<exist_fact->get_point_to_vars().size(); j++) {
733 const Variable* pointee = exist_fact->get_point_to_vars()[j];
734 add_variable_to_set(pointee_vars, pointee);
735 }
736 }
737 }
738 return pointee_vars;
739}
740
741/*
742 * check if one of the array indices is based on given variable, if yes, modifying

Callers

nothing calls this directly

Calls 3

find_related_factFunction · 0.85
add_variable_to_setFunction · 0.85
sizeMethod · 0.80

Tested by

no test coverage detected