@@ -129,7 +129,7 @@ void path_symext::assign(
129
129
130
130
// start recursion on lhs
131
131
exprt::operandst _guard; // start with empty guard
132
- assign_rec (state, _guard, ssa_lhs, ssa_rhs);
132
+ assign_rec (state, _guard, lhs, ssa_lhs, ssa_rhs);
133
133
}
134
134
135
135
inline static typet c_sizeof_type_rec (const exprt &expr)
@@ -347,6 +347,7 @@ void path_symext::symex_va_arg_next(
347
347
void path_symext::assign_rec (
348
348
path_symex_statet &state,
349
349
exprt::operandst &guard,
350
+ const exprt &full_lhs,
350
351
const exprt &ssa_lhs,
351
352
const exprt &ssa_rhs)
352
353
{
@@ -376,17 +377,17 @@ void path_symext::assign_rec(
376
377
377
378
// increase the SSA counter and produce new SSA symbol expression
378
379
var_info.increment_ssa_counter ();
379
- symbol_exprt new_lhs =var_info.ssa_symbol ();
380
+ symbol_exprt new_ssa_lhs =var_info.ssa_symbol ();
380
381
381
382
#ifdef DEBUG
382
- std::cout << " new_lhs : " << new_lhs .get_identifier () << ' \n ' ;
383
+ std::cout << " new_ssa_lhs : " << new_ssa_lhs .get_identifier () << ' \n ' ;
383
384
#endif
384
385
385
386
// record new state of lhs
386
387
{
387
388
// reference is not stable
388
389
path_symex_statet::var_statet &var_state=state.get_var_state (var_info);
389
- var_state.ssa_symbol =new_lhs ;
390
+ var_state.ssa_symbol =new_ssa_lhs ;
390
391
}
391
392
392
393
// rhs nil means non-det assignment
@@ -398,11 +399,11 @@ void path_symext::assign_rec(
398
399
else
399
400
{
400
401
// consistency check
401
- if (!base_type_eq (ssa_rhs.type (), new_lhs .type (), state.var_map .ns ))
402
+ if (!base_type_eq (ssa_rhs.type (), new_ssa_lhs .type (), state.var_map .ns ))
402
403
{
403
404
#ifdef DEBUG
404
405
std::cout << " ssa_rhs: " << ssa_rhs.pretty () << ' \n ' ;
405
- std::cout << " new_lhs : " << new_lhs .pretty () << ' \n ' ;
406
+ std::cout << " new_ssa_lhs : " << new_ssa_lhs .pretty () << ' \n ' ;
406
407
#endif
407
408
throw " assign_rec got different types" ;
408
409
}
@@ -413,8 +414,8 @@ void path_symext::assign_rec(
413
414
414
415
if (!guard.empty ())
415
416
step.guard =conjunction (guard);
416
- step.full_lhs =ssa_lhs ;
417
- step.ssa_lhs =new_lhs ;
417
+ step.full_lhs =full_lhs ;
418
+ step.ssa_lhs =new_ssa_lhs ;
418
419
step.ssa_rhs =ssa_rhs;
419
420
420
421
// propagate the rhs?
@@ -425,10 +426,10 @@ void path_symext::assign_rec(
425
426
else if (ssa_lhs.id ()==ID_typecast)
426
427
{
427
428
// dereferencing might yield a typecast
428
- const exprt &new_lhs =to_typecast_expr (ssa_lhs).op ();
429
- typecast_exprt new_rhs (ssa_rhs, new_lhs .type ());
429
+ const exprt &new_ssa_lhs =to_typecast_expr (ssa_lhs).op ();
430
+ typecast_exprt new_rhs (ssa_rhs, new_ssa_lhs .type ());
430
431
431
- assign_rec (state, guard, new_lhs , new_rhs);
432
+ assign_rec (state, guard, full_lhs, new_ssa_lhs , new_rhs);
432
433
}
433
434
else if (ssa_lhs.id ()==ID_member)
434
435
{
@@ -454,17 +455,17 @@ void path_symext::assign_rec(
454
455
455
456
with_exprt new_rhs (struct_op, member_name, ssa_rhs);
456
457
457
- assign_rec (state, guard, struct_op, new_rhs);
458
+ assign_rec (state, guard, full_lhs, struct_op, new_rhs);
458
459
}
459
460
else if (compound_type.id ()==ID_union)
460
461
{
461
462
// rewrite into byte_extract, and do again
462
463
exprt offset=from_integer (0 , index_type ());
463
464
464
465
byte_extract_exprt
465
- new_lhs (byte_update_id (), struct_op, offset, ssa_rhs.type ());
466
+ new_ssa_lhs (byte_update_id (), struct_op, offset, ssa_rhs.type ());
466
467
467
- assign_rec (state, guard, new_lhs , ssa_rhs);
468
+ assign_rec (state, guard, full_lhs, new_ssa_lhs , ssa_rhs);
468
469
}
469
470
else
470
471
throw " assign_rec: member expects struct or union type" ;
@@ -496,12 +497,12 @@ void path_symext::assign_rec(
496
497
497
498
// true
498
499
guard.push_back (cond);
499
- assign_rec (state, guard, lhs_if_expr.true_case (), ssa_rhs);
500
+ assign_rec (state, guard, full_lhs, lhs_if_expr.true_case (), ssa_rhs);
500
501
guard.pop_back ();
501
502
502
503
// false
503
504
guard.push_back (not_exprt (cond));
504
- assign_rec (state, guard, lhs_if_expr.false_case (), ssa_rhs);
505
+ assign_rec (state, guard, full_lhs, lhs_if_expr.false_case (), ssa_rhs);
505
506
guard.pop_back ();
506
507
}
507
508
else if (ssa_lhs.id ()==ID_byte_extract_little_endian ||
@@ -533,9 +534,9 @@ void path_symext::assign_rec(
533
534
new_rhs.offset ()=byte_extract_expr.offset ();
534
535
new_rhs.value ()=ssa_rhs;
535
536
536
- const exprt new_lhs =byte_extract_expr.op ();
537
+ const exprt new_ssa_lhs =byte_extract_expr.op ();
537
538
538
- assign_rec (state, guard, new_lhs , new_rhs);
539
+ assign_rec (state, guard, full_lhs, new_ssa_lhs , new_rhs);
539
540
}
540
541
else if (ssa_lhs.id ()==ID_struct)
541
542
{
@@ -555,7 +556,7 @@ void path_symext::assign_rec(
555
556
exprt::operandst::const_iterator lhs_it=operands.begin ();
556
557
forall_operands (it, ssa_rhs)
557
558
{
558
- assign_rec (state, guard, *lhs_it, *it);
559
+ assign_rec (state, guard, full_lhs, *lhs_it, *it);
559
560
++lhs_it;
560
561
}
561
562
}
@@ -571,7 +572,7 @@ void path_symext::assign_rec(
571
572
components[i].get_name (),
572
573
components[i].type ()),
573
574
state.var_map .ns );
574
- assign_rec (state, guard, operands[i], new_rhs);
575
+ assign_rec (state, guard, full_lhs, operands[i], new_rhs);
575
576
}
576
577
}
577
578
}
@@ -594,7 +595,7 @@ void path_symext::assign_rec(
594
595
exprt::operandst::const_iterator lhs_it=operands.begin ();
595
596
forall_operands (it, ssa_rhs)
596
597
{
597
- assign_rec (state, guard, *lhs_it, *it);
598
+ assign_rec (state, guard, full_lhs, *lhs_it, *it);
598
599
++lhs_it;
599
600
}
600
601
}
@@ -610,7 +611,7 @@ void path_symext::assign_rec(
610
611
from_integer (i, index_type ()),
611
612
array_type.subtype ()),
612
613
state.var_map .ns );
613
- assign_rec (state, guard, operands[i], new_rhs);
614
+ assign_rec (state, guard, full_lhs, operands[i], new_rhs);
614
615
}
615
616
}
616
617
}
@@ -1090,6 +1091,10 @@ void path_symext::operator()(
1090
1091
{
1091
1092
// just needs to be recorded
1092
1093
}
1094
+ else if (statement==ID_output)
1095
+ {
1096
+ // just needs to be recorded
1097
+ }
1093
1098
else
1094
1099
throw " unexpected OTHER statement: " +id2string (statement);
1095
1100
}
0 commit comments