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

Method has_dereferenceable_var

src/VariableSelector.cpp:218–229  ·  view source on GitHub ↗

return true if a variable in the list is a pointer to type "type" */

Source from the content-addressed store, hash-verified

216
217/* return true if a variable in the list is a pointer to type "type" */
218bool
219VariableSelector::has_dereferenceable_var(const vector<Variable *>& vars, const Type* type, const CGContext& cg_context)
220{
221 FactMgr* fm = get_fact_mgr(&cg_context);
222 for (size_t i=0; i<vars.size(); i++) {
223 Variable* var = vars[i];
224 if (type->is_dereferenced_from(var->type) && FactPointTo::is_valid_ptr(var, fm->global_facts)) {
225 return true;
226 }
227 }
228 return false;
229}
230
231/*
232 * check if a variable is eligible to be selected based on current context and

Callers

nothing calls this directly

Calls 3

get_fact_mgrFunction · 0.85
sizeMethod · 0.80
is_dereferenced_fromMethod · 0.80

Tested by

no test coverage detected