@@ -3440,7 +3440,7 @@ Function: verilog_synthesist::symbol_expr
3440
3440
3441
3441
exprt verilog_synthesist::symbol_expr (
3442
3442
const symbolt &symbol,
3443
- curr_or_nextt curr_or_next)
3443
+ curr_or_nextt curr_or_next) const
3444
3444
{
3445
3445
exprt result=exprt (curr_or_next==NEXT?ID_next_symbol:ID_symbol, symbol.type );
3446
3446
result.set (ID_identifier, symbol.name );
@@ -3563,21 +3563,23 @@ Function: verilog_synthesist::current_value
3563
3563
exprt verilog_synthesist::current_value (
3564
3564
const value_mapt::mapt &map,
3565
3565
const symbolt &symbol,
3566
- bool use_previous_assignments)
3566
+ bool use_previous_assignments) const
3567
3567
{
3568
3568
if (!symbol.is_state_var )
3569
3569
{
3570
3570
if (use_previous_assignments)
3571
3571
{
3572
3572
// see if we have a previous assignment
3573
- const assignmentt &assignment=assignments[symbol.name ];
3574
- const exprt &value=
3575
- (construct==constructt::INITIAL)?
3576
- assignment.init .value :
3577
- assignment.next .value ;
3573
+ auto assignment_it = assignments.find (symbol.name );
3574
+ if (assignment_it != assignments.end ())
3575
+ {
3576
+ const exprt &value = (construct == constructt::INITIAL)
3577
+ ? assignment_it->second .init .value
3578
+ : assignment_it->second .next .value ;
3578
3579
3579
- if (value.is_not_nil ())
3580
- return value; // done
3580
+ if (value.is_not_nil ())
3581
+ return value; // done
3582
+ }
3581
3583
}
3582
3584
3583
3585
return symbol_expr (symbol, CURRENT);
@@ -3593,13 +3595,16 @@ exprt verilog_synthesist::current_value(
3593
3595
if (use_previous_assignments)
3594
3596
{
3595
3597
// see if we have a previous assignment
3596
- const assignmentt &assignment=assignments[symbol.name ];
3597
- const exprt &value=
3598
- (construct==constructt::INITIAL)?
3599
- assignment.init .value :assignment.next .value ;
3598
+ auto assignment_it = assignments.find (symbol.name );
3599
+ if (assignment_it != assignments.end ())
3600
+ {
3601
+ const exprt &value = (construct == constructt::INITIAL)
3602
+ ? assignment_it->second .init .value
3603
+ : assignment_it->second .next .value ;
3600
3604
3601
- if (value.is_not_nil ())
3602
- return value; // done
3605
+ if (value.is_not_nil ())
3606
+ return value; // done
3607
+ }
3603
3608
}
3604
3609
3605
3610
if (
0 commit comments