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

Method make_random

src/StatementExpr.cpp:54–72  ·  view source on GitHub ↗

* */

Source from the content-addressed store, hash-verified

52 *
53 */
54StatementExpr *
55StatementExpr::make_random(CGContext &cg_context)
56{
57 DEPTH_GUARD_BY_TYPE_RETURN(dtStatementExpr, NULL);
58 FunctionInvocation *invoke;
59 // make copies
60 Effect pre_effect = cg_context.get_accum_effect();
61 FactMgr* fm = get_fact_mgr(&cg_context);
62 vector<const Fact*> facts_copy = fm->global_facts;
63 invoke = FunctionInvocation::make_random(false, cg_context, 0, 0);
64 ERROR_GUARD(NULL);
65 if (invoke->failed) {
66 cg_context.reset_effect_accum(pre_effect);
67 fm->restore_facts(facts_copy);
68 delete invoke;
69 return 0;
70 }
71 return new StatementExpr(cg_context.get_current_block(), *invoke);
72}
73
74/*
75 *

Callers

nothing calls this directly

Calls 5

get_fact_mgrFunction · 0.85
get_accum_effectMethod · 0.80
reset_effect_accumMethod · 0.80
restore_factsMethod · 0.80
get_current_blockMethod · 0.80

Tested by

no test coverage detected