@@ -479,7 +479,7 @@ void goto_convertt::convert(
479
479
else if (statement==ID_while)
480
480
convert_while (to_code_while (code), dest, mode);
481
481
else if (statement==ID_dowhile)
482
- convert_dowhile (code, dest, mode);
482
+ convert_dowhile (to_code_dowhile ( code) , dest, mode);
483
483
else if (statement==ID_switch)
484
484
convert_switch (to_code_switch (code), dest, mode);
485
485
else if (statement==ID_break)
@@ -1131,21 +1131,14 @@ void goto_convertt::convert_while(
1131
1131
}
1132
1132
1133
1133
void goto_convertt::convert_dowhile (
1134
- const codet &code,
1134
+ const code_dowhilet &code,
1135
1135
goto_programt &dest,
1136
1136
const irep_idt &mode)
1137
1137
{
1138
- if (code.operands ().size ()!=2 )
1139
- {
1140
- error ().source_location =code.find_source_location ();
1141
- error () << " dowhile takes two operands" << eom;
1142
- throw 0 ;
1143
- }
1144
-
1145
1138
// save source location
1146
- source_locationt condition_location=code.op0 ().find_source_location ();
1139
+ source_locationt condition_location=code.cond ().find_source_location ();
1147
1140
1148
- exprt cond=code.op0 ();
1141
+ exprt cond=code.cond ();
1149
1142
1150
1143
goto_programt sideeffects;
1151
1144
clean_expr (cond, sideeffects, mode);
@@ -1183,7 +1176,7 @@ void goto_convertt::convert_dowhile(
1183
1176
1184
1177
// do the w label
1185
1178
goto_programt tmp_w;
1186
- convert (to_code ( code.op1 () ), tmp_w, mode);
1179
+ convert (code.body ( ), tmp_w, mode);
1187
1180
goto_programt::targett w=tmp_w.instructions .begin ();
1188
1181
1189
1182
// y: if(c) goto w;
0 commit comments