@@ -1481,15 +1481,11 @@ void goto_checkt::add_guarded_property(
1481
1481
1482
1482
if (assertions.insert (guarded_expr).second )
1483
1483
{
1484
- goto_program_instruction_typet type=
1485
- enable_assert_to_assume?ASSUME:ASSERT;
1486
-
1487
- goto_programt::targett t = new_code.add (goto_programt::instructiont (
1488
- static_cast <const codet &>(get_nil_irep ()),
1489
- source_location,
1490
- type,
1491
- std::move (new_expr),
1492
- {}));
1484
+ auto t = new_code.add (
1485
+ enable_assert_to_assume ? goto_programt::make_assumption (
1486
+ std::move (guarded_expr), source_location)
1487
+ : goto_programt::make_assertion (
1488
+ std::move (guarded_expr), source_location));
1493
1489
1494
1490
std::string source_expr_string;
1495
1491
get_language_from_mode (mode)->from_expr (src_expr, source_expr_string, ns);
@@ -1856,15 +1852,10 @@ void goto_checkt::goto_check(
1856
1852
{
1857
1853
if (std::find (i.labels .begin (), i.labels .end (), label)!=i.labels .end ())
1858
1854
{
1859
- goto_program_instruction_typet type=
1860
- enable_assert_to_assume?ASSUME:ASSERT;
1861
-
1862
- goto_programt::targett t = new_code.add (goto_programt::instructiont (
1863
- static_cast <const codet &>(get_nil_irep ()),
1864
- i.source_location ,
1865
- type,
1866
- false_exprt (),
1867
- {}));
1855
+ auto t = new_code.add (
1856
+ enable_assert_to_assume
1857
+ ? goto_programt::make_assumption (false_exprt{}, i.source_location )
1858
+ : goto_programt::make_assertion (false_exprt{}, i.source_location ));
1868
1859
1869
1860
t->source_location .set_property_class (" error label" );
1870
1861
t->source_location .set_comment (" error label " +label);
0 commit comments