@@ -121,6 +121,7 @@ void goto_convertt::finish_gotos(goto_programt &dest)
121
121
// appropriate for however many automatic variables leave scope.
122
122
// We don't currently handle variables *entering* scope, which is illegal
123
123
// for C++ non-pod types and impossible in Java in any case.
124
+ /*
124
125
auto goto_stack=it.second;
125
126
const auto& label_stack=l_it->second.second;
126
127
bool stack_is_prefix=true;
@@ -148,6 +149,7 @@ void goto_convertt::finish_gotos(goto_programt &dest)
148
149
// is std::list.
149
150
}
150
151
}
152
+ */
151
153
}
152
154
else
153
155
{
@@ -231,21 +233,21 @@ Function: goto_convertt::finish_guarded_gotos
231
233
232
234
void goto_convertt::finish_guarded_gotos (goto_programt &dest)
233
235
{
234
- std::map<goto_programt::targett, int > itertoint;
235
-
236
- int i=0 ;
237
- for (goto_programt::targett it = dest.instructions .begin (), itend=dest.instructions .end ();
238
- it!=itend; ++it,++i)
239
- itertoint[it]=i;
240
-
241
236
for (auto & gg : guarded_gotos)
242
237
{
243
238
// Check if any destructor code has been inserted:
244
239
bool destructor_present=false ;
245
240
for (auto it=gg.ifiter ; it!=gg.gotoiter && !destructor_present; ++it)
246
241
{
247
- if (!(it->is_goto () || it->is_skip ()))
248
- destructor_present=true ;
242
+ switch (it->type )
243
+ {
244
+ case GOTO:
245
+ case SKIP:
246
+ continue ;
247
+ default :
248
+ destructor_present=true ;
249
+ break ;
250
+ }
249
251
}
250
252
251
253
// If so, can't simplify.
@@ -299,7 +301,7 @@ void goto_convertt::goto_convert_rec(
299
301
300
302
finish_gotos (dest);
301
303
finish_computed_gotos (dest);
302
- finish_guarded_gotos (dest);
304
+ // finish_guarded_gotos(dest);
303
305
}
304
306
305
307
/* ******************************************************************\
@@ -2265,7 +2267,9 @@ void goto_convertt::generate_ifthenelse(
2265
2267
// if(some) { label: goto somewhere; }
2266
2268
// Don't perform the transformation here, as code might get inserted into
2267
2269
// the true case to perform destructors. This will be attempted in finish_guarded_gotos.
2268
- is_guarded_goto=true ;
2270
+ // is_guarded_goto=true;
2271
+ true_case.instructions .back ().guard =guard;
2272
+ dest.destructive_append (true_case);
2269
2273
}
2270
2274
2271
2275
// similarly, do guarded assertions directly
0 commit comments