@@ -3404,7 +3404,7 @@ Function: verilog_synthesist::symbol_expr
3404
3404
3405
3405
exprt verilog_synthesist::symbol_expr (
3406
3406
const symbolt &symbol,
3407
- curr_or_nextt curr_or_next)
3407
+ curr_or_nextt curr_or_next) const
3408
3408
{
3409
3409
exprt result=exprt (curr_or_next==NEXT?ID_next_symbol:ID_symbol, symbol.type );
3410
3410
result.set (ID_identifier, symbol.name );
@@ -3527,21 +3527,23 @@ Function: verilog_synthesist::current_value
3527
3527
exprt verilog_synthesist::current_value (
3528
3528
const value_mapt::mapt &map,
3529
3529
const symbolt &symbol,
3530
- bool use_previous_assignments)
3530
+ bool use_previous_assignments) const
3531
3531
{
3532
3532
if (!symbol.is_state_var )
3533
3533
{
3534
3534
if (use_previous_assignments)
3535
3535
{
3536
3536
// see if we have a previous assignment
3537
- const assignmentt &assignment=assignments[symbol.name ];
3538
- const exprt &value=
3539
- (construct==constructt::INITIAL)?
3540
- assignment.init .value :
3541
- assignment.next .value ;
3537
+ auto assignment_it = assignments.find (symbol.name );
3538
+ if (assignment_it != assignments.end ())
3539
+ {
3540
+ const exprt &value = (construct == constructt::INITIAL)
3541
+ ? assignment_it->second .init .value
3542
+ : assignment_it->second .next .value ;
3542
3543
3543
- if (value.is_not_nil ())
3544
- return value; // done
3544
+ if (value.is_not_nil ())
3545
+ return value; // done
3546
+ }
3545
3547
}
3546
3548
3547
3549
return symbol_expr (symbol, CURRENT);
@@ -3557,13 +3559,16 @@ exprt verilog_synthesist::current_value(
3557
3559
if (use_previous_assignments)
3558
3560
{
3559
3561
// see if we have a previous assignment
3560
- const assignmentt &assignment=assignments[symbol.name ];
3561
- const exprt &value=
3562
- (construct==constructt::INITIAL)?
3563
- assignment.init .value :assignment.next .value ;
3562
+ auto assignment_it = assignments.find (symbol.name );
3563
+ if (assignment_it != assignments.end ())
3564
+ {
3565
+ const exprt &value = (construct == constructt::INITIAL)
3566
+ ? assignment_it->second .init .value
3567
+ : assignment_it->second .next .value ;
3564
3568
3565
- if (value.is_not_nil ())
3566
- return value; // done
3569
+ if (value.is_not_nil ())
3570
+ return value; // done
3571
+ }
3567
3572
}
3568
3573
3569
3574
if (
0 commit comments