Skip to content

Commit 6927609

Browse files
committed
Use the code_fort API
Do not use the low-level op0, etc making assumptions about the implementation details.
1 parent 7300776 commit 6927609

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

src/ansi-c/expr2c.cpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2801,16 +2801,16 @@ std::string expr2ct::convert_code_for(
28012801
std::string dest=indent_str(indent);
28022802
dest+="for(";
28032803

2804-
if(!src.op0().is_nil())
2805-
dest+=convert(src.op0());
2804+
if(!src.init().is_nil())
2805+
dest += convert(src.init());
28062806
else
28072807
dest+=' ';
28082808
dest+="; ";
2809-
if(!src.op1().is_nil())
2810-
dest+=convert(src.op1());
2809+
if(!src.cond().is_nil())
2810+
dest += convert(src.cond());
28112811
dest+="; ";
2812-
if(!src.op2().is_nil())
2813-
dest+=convert(src.op2());
2812+
if(!src.iter().is_nil())
2813+
dest += convert(src.iter());
28142814

28152815
if(src.body().is_nil())
28162816
dest+=");\n";

src/goto-programs/goto_convert.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -952,7 +952,7 @@ void goto_convertt::convert_for(
952952
// do the x label
953953
goto_programt tmp_x;
954954

955-
if(code.op2().is_nil())
955+
if(code.iter().is_nil())
956956
{
957957
tmp_x.add_instruction(SKIP);
958958
tmp_x.instructions.back().source_location=code.source_location();

0 commit comments

Comments
 (0)