Skip to content

Commit b5b7a50

Browse files
author
Owen
committed
Fix bug in simplify_dereference_rec
The two operands to the plus_exprt don't need to have the same type as each other.
1 parent 261a053 commit b5b7a50

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/util/simplify_expr.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ Author: Daniel Kroening, [email protected]
2121
#include "mathematical_expr.h"
2222
#include "namespace.h"
2323
#include "pointer_offset_size.h"
24+
#include "pointer_offset_sum.h"
2425
#include "rational.h"
2526
#include "rational_tools.h"
2627
#include "simplify_utils.h"
@@ -904,7 +905,7 @@ bool simplify_exprt::simplify_dereference(exprt &expr)
904905
{
905906
index_exprt idx(
906907
old.array(),
907-
plus_exprt(old.index(), pointer.op1()),
908+
pointer_offset_sum(old.index(), pointer.op1()),
908909
old.array().type().subtype());
909910
simplify_rec(idx);
910911
expr.swap(idx);

0 commit comments

Comments
 (0)