File tree 1 file changed +5
-8
lines changed 1 file changed +5
-8
lines changed Original file line number Diff line number Diff line change @@ -676,24 +676,21 @@ void goto_programt::instructiont::validate(
676
676
validate_expr_full_pick (guard, ns, vm);
677
677
678
678
auto evaluates_to_boolean = [](const exprt &e) -> bool {
679
- // typecast to Boolean
679
+ if (e.type ().id () != ID_bool)
680
+ return false ;
681
+
680
682
if (e.id () == ID_typecast)
681
683
return e.type ().id () == ID_bool;
682
684
683
685
// Boolean constants
684
686
if (e.id () == ID_true || e.id () == ID_false)
685
687
return true ;
686
- if (e.id () == ID_constant && e. type (). id () == ID_bool )
688
+ if (e.id () == ID_constant)
687
689
return true ;
688
690
689
691
// Symbols
690
692
if (e.id () == ID_symbol)
691
- {
692
- if (e.type ().id () == ID_code) // function call
693
- return to_code_type (e.type ()).return_type ().id () == ID_bool;
694
- else // Boolean variable
695
- return e.type ().id () == ID_bool;
696
- }
693
+ return true ;
697
694
698
695
// arithmetic relations
699
696
if (e.id () == ID_equal || e.id () == ID_notequal)
You can’t perform that action at this time.
0 commit comments