Skip to content

Commit 48ca7a3

Browse files
author
thk123
committed
Corrected lhs simplification
True means no simplification has occured so this should be reflected in the lhs simplification
1 parent c763a2a commit 48ca7a3

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

src/analyses/variable-sensitivity/variable_sensitivity_domain.cpp

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -374,42 +374,42 @@ bool variable_sensitivity_domaint::ai_simplify_lhs(
374374
{
375375
index_exprt ie = to_index_expr(condition);
376376
exprt index = ie.index();
377-
bool changed = ai_simplify(index, ns);
378-
if(changed)
377+
bool no_simplification=ai_simplify(index, ns);
378+
if(!no_simplification)
379379
{
380380
ie.index() = index;
381381
condition = simplify_expr(ie, ns);
382382
}
383383

384-
return !changed;
384+
return no_simplification;
385385
}
386386
else if(condition.id()==ID_dereference)
387387
{
388388
dereference_exprt de = to_dereference_expr(condition);
389389
exprt pointer = de.pointer();
390-
bool changed = ai_simplify(pointer, ns);
391-
if(changed)
390+
bool no_simplification = ai_simplify(pointer, ns);
391+
if(!no_simplification)
392392
{
393393
de.pointer() = pointer;
394394
condition = simplify_expr(de, ns); // So *(&x) -> x
395395
}
396396

397-
return !changed;
397+
return no_simplification;
398398
}
399399
else if(condition.id()==ID_member)
400400
{
401401
member_exprt me = to_member_expr(condition);
402402
exprt compound = me.compound();
403403
// Carry on the RHS since we still require an addressable object for the
404404
// struct
405-
bool changed = ai_simplify_lhs(compound, ns);
406-
if(changed)
405+
bool no_simplification = ai_simplify_lhs(compound, ns);
406+
if(!no_simplification)
407407
{
408408
me.compound() = compound;
409409
condition = simplify_expr(me, ns);
410410
}
411411

412-
return !changed;
412+
return no_simplification;
413413
}
414414
else
415415
return true;

0 commit comments

Comments
 (0)