@@ -109,28 +109,7 @@ void goto_convertt::finish_gotos(goto_programt &dest, const irep_idt &mode)
109109 {
110110 goto_programt::instructiont &i=*(g_it.first );
111111
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 ())
134113 {
135114 const irep_idt &goto_label=i.code .get (ID_destination);
136115
@@ -159,6 +138,7 @@ void goto_convertt::finish_gotos(goto_programt &dest, const irep_idt &mode)
159138 throw 0 ;
160139 }
161140
141+ i.type =GOTO;
162142 i.targets .clear ();
163143 i.targets .push_back (l_it->second .first );
164144
@@ -1480,21 +1460,21 @@ void goto_convertt::convert_goto(
14801460 const codet &code,
14811461 goto_programt &dest)
14821462{
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 );
14851465 t->source_location =code.source_location ();
14861466 t->code =code;
14871467
1488- // remember it to do target later
1468+ // remember it to do the target later
14891469 targets.gotos .push_back (std::make_pair (t, targets.destructor_stack ));
14901470}
14911471
14921472void goto_convertt::convert_gcc_computed_goto (
14931473 const codet &code,
14941474 goto_programt &dest)
14951475{
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 );
14981478 t->source_location =code.source_location ();
14991479 t->code =code;
15001480
0 commit comments