* */
| 52 | * |
| 53 | */ |
| 54 | StatementExpr * |
| 55 | StatementExpr::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 | * |
nothing calls this directly
no test coverage detected