Skip to content

Commit

Permalink
fix a bugs in generating side-effecting expressions
Browse files Browse the repository at this point in the history
avoid writing to volatile storages when creating embedded assignments or prefix/postfix ++/-- operators. This is for the benefit of effect analysis.
  • Loading branch information
Xuejun Yang committed Jul 22, 2011
1 parent 3088484 commit a791a6f
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/ExpressionAssign.cpp
Expand Up @@ -47,6 +47,11 @@
Expression *
ExpressionAssign::make_random(CGContext &cg_context, const Type* type, const CVQualifiers* qfer)
{
CVQualifiers qf;
if (qfer == NULL) {
qf = CVQualifiers::random_qualifiers(type, Effect::WRITE, cg_context, true);
qfer = &qf;
}
StatementAssign* sa = StatementAssign::make_random(cg_context, type, qfer);
FactMgr* fm = get_fact_mgr(&cg_context);
update_fact_for_assign(sa, fm->global_facts);
Expand Down

0 comments on commit a791a6f

Please sign in to comment.