Skip to content

Commit 240daac

Browse files
authored
Merge pull request #6967 from tautschnig/bugfixes/6966-simplify-string-constant-eq
Simplify equality of address-of-string-constant
2 parents f68a2f2 + 897034a commit 240daac

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/util/simplify_expr_pointer.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -467,6 +467,12 @@ simplify_exprt::resultt<> simplify_exprt::simplify_inequality_address_of(
467467
{
468468
return make_boolean_expr(expr.id() != ID_equal);
469469
}
470+
else if(
471+
tmp0_object.id() == ID_string_constant &&
472+
tmp1_object.id() == ID_string_constant && tmp0_object == tmp1_object)
473+
{
474+
return make_boolean_expr(expr.id() == ID_equal);
475+
}
470476

471477
return unchanged(expr);
472478
}

0 commit comments

Comments
 (0)