Skip to content

Commit 1818f4a

Browse files
author
Daniel Kroening
committed
expr2ct::convert_code_assign now builds a temporary expression
1 parent 3f9f4d7 commit 1818f4a

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

src/ansi-c/expr2c.cpp

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2958,7 +2958,15 @@ std::string expr2ct::convert_code_assign(
29582958
const code_assignt &src,
29592959
unsigned indent)
29602960
{
2961-
std::string tmp=convert_binary(src, "=", 2, true);
2961+
if(src.operands().size()!=2)
2962+
{
2963+
unsigned precedence;
2964+
return convert_norep(src, precedence);
2965+
}
2966+
2967+
binary_exprt tmp_binary(src.lhs(), ID_assign, src.rhs());
2968+
2969+
std::string tmp=convert_binary(tmp_binary, "=", 2, true);
29622970

29632971
std::string dest=indent_str(indent)+tmp+";";
29642972

0 commit comments

Comments
 (0)