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

Method must_return

src/Block.cpp:359–376  ·  view source on GitHub ↗

* return true if there is no way out of this block other than function return */

Source from the content-addressed store, hash-verified

357 * return true if there is no way out of this block other than function return
358 */
359bool
360Block::must_return(void) const
361{
362 if (stms.size() > 0 && break_stms.size() == 0 && get_last_stm()->must_return()) {
363 vector<const CFGEdge*> edges;
364 if (find_edges_in(edges, false, true)) {
365 // if there is a statement goes back to block (most likely "continue")
366 // then this block has a chance to escape the return statement at the end
367 for (size_t i=0; i<edges.size(); i++) {
368 if (edges[i]->src != this) {
369 return false;
370 }
371 }
372 }
373 return true;
374 }
375 return false;
376}
377
378/*
379 * return true if there is no way out of this block other than jump

Callers 7

make_randomMethod · 0.45
find_good_jump_blockMethod · 0.45
make_randomMethod · 0.45
must_break_or_returnMethod · 0.45
visit_factsMethod · 0.45
post_loop_analysisMethod · 0.45
visit_factsMethod · 0.45

Calls 1

sizeMethod · 0.80

Tested by

no test coverage detected