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

Method get_one_function

src/Function.cpp:251–264  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

249}
250
251Function *
252Function::get_one_function(const vector<Function *> &ok_funcs)
253{
254 vector<Function *>::size_type ok_size = ok_funcs.size();
255
256 if (ok_size == 0) {
257 return 0;
258 }
259 if (ok_size == 1) {
260 return ok_funcs[0];
261 }
262 int index = rnd_upto(ok_size);
263 return ok_funcs[index];
264}
265
266/*
267 * Choose a function from `funcs' to invoke.

Callers

nothing calls this directly

Calls 2

rnd_uptoFunction · 0.85
sizeMethod · 0.80

Tested by

no test coverage detected