@@ -109,28 +109,7 @@ void goto_convertt::finish_gotos(goto_programt &dest, const irep_idt &mode)
109
109
{
110
110
goto_programt::instructiont &i=*(g_it.first );
111
111
112
- if (i.code .get_statement ()==" non-deterministic-goto" )
113
- {
114
- const irept &destinations=i.code .find (" destinations" );
115
-
116
- i.make_goto ();
117
-
118
- forall_irep (it, destinations.get_sub ())
119
- {
120
- labelst::const_iterator l_it=
121
- targets.labels .find (it->id_string ());
122
-
123
- if (l_it==targets.labels .end ())
124
- {
125
- error ().source_location =i.code .find_source_location ();
126
- error () << " goto label `" << it->id () << " ' not found" << eom;
127
- throw 0 ;
128
- }
129
-
130
- i.targets .push_back (l_it->second .first );
131
- }
132
- }
133
- else if (i.is_start_thread ())
112
+ if (i.is_start_thread ())
134
113
{
135
114
const irep_idt &goto_label=i.code .get (ID_destination);
136
115
@@ -159,6 +138,7 @@ void goto_convertt::finish_gotos(goto_programt &dest, const irep_idt &mode)
159
138
throw 0 ;
160
139
}
161
140
141
+ i.type =GOTO;
162
142
i.targets .clear ();
163
143
i.targets .push_back (l_it->second .first );
164
144
@@ -1480,21 +1460,21 @@ void goto_convertt::convert_goto(
1480
1460
const codet &code,
1481
1461
goto_programt &dest)
1482
1462
{
1483
- goto_programt::targett t=dest. add_instruction ();
1484
- t-> make_goto ( );
1463
+ // this instruction will turn into a goto during post-processing
1464
+ goto_programt::targett t=dest. add_instruction (NO_INSTRUCTION_TYPE );
1485
1465
t->source_location =code.source_location ();
1486
1466
t->code =code;
1487
1467
1488
- // remember it to do target later
1468
+ // remember it to do the target later
1489
1469
targets.gotos .push_back (std::make_pair (t, targets.destructor_stack ));
1490
1470
}
1491
1471
1492
1472
void goto_convertt::convert_gcc_computed_goto (
1493
1473
const codet &code,
1494
1474
goto_programt &dest)
1495
1475
{
1496
- goto_programt::targett t=dest. add_instruction ();
1497
- t-> make_skip ( );
1476
+ // this instruction will turn into OTHER during post-processing
1477
+ goto_programt::targett t=dest. add_instruction (NO_INSTRUCTION_TYPE );
1498
1478
t->source_location =code.source_location ();
1499
1479
t->code =code;
1500
1480
0 commit comments