Skip to content

Commit dec3da4

Browse files
author
Daniel Kroening
committed
expr2ct::convert_code_assign now builds a temporary expression
1 parent 4499c99 commit dec3da4

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
@@ -2967,7 +2967,15 @@ std::string expr2ct::convert_code_assign(
29672967
const code_assignt &src,
29682968
unsigned indent)
29692969
{
2970-
std::string tmp=convert_binary(src, "=", 2, true);
2970+
if(src.operands().size()!=2)
2971+
{
2972+
unsigned precedence;
2973+
return convert_norep(src, precedence);
2974+
}
2975+
2976+
binary_exprt tmp_binary(src.lhs(), ID_assign, src.rhs());
2977+
2978+
std::string tmp=convert_binary(tmp_binary, "=", 2, true);
29712979

29722980
std::string dest=indent_str(indent)+tmp+";";
29732981

0 commit comments

Comments
 (0)