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

Method join_visits

src/FactPointTo.cpp:601–623  ·  view source on GitHub ↗

* join two facts from two visits to the same function * return 1 if changed, 0 otherwise */

Source from the content-addressed store, hash-verified

599 * return 1 if changed, 0 otherwise
600 */
601int
602FactPointTo::join_visits(const Fact& f)
603{
604 // ignore tbd fact from either visit
605 int changed = 0;
606 if (is_related(f)) {
607 const FactPointTo& fact = (const FactPointTo&)f;
608 if (!fact.is_tbd_only()) {
609 const vector<const Variable*>& vars = fact.get_point_to_vars();
610 if (is_tbd_only()) {
611 point_to_vars.clear();
612 }
613 for (size_t i=0; i<vars.size(); i++) {
614 const Variable* v = vars[i];
615 if (!is_variable_in_set(point_to_vars, v)) {
616 point_to_vars.push_back(v);
617 changed = 1;
618 }
619 }
620 }
621 }
622 return changed;
623}
624
625/*
626 * return false if point-to already contains point-to-set in f, true otherwise

Callers

nothing calls this directly

Calls 4

is_variable_in_setFunction · 0.85
is_tbd_onlyMethod · 0.80
sizeMethod · 0.80
clearMethod · 0.45

Tested by

no test coverage detected