Skip to content

Commit 992a3c3

Browse files
committed
Simplify object descriptor offset after construction
Leaving this with trivially simplifiable expressions such as (0 + 0) means subsequent simplifications that check for offset.is_constant() may be wrongly skipped.
1 parent 2d72002 commit 992a3c3

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

src/util/std_expr.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ Author: Daniel Kroening, [email protected]
1616
#include "expr_util.h"
1717
#include "mathematical_types.h"
1818
#include "pointer_offset_size.h"
19+
#include "simplify_expr.h"
1920

2021
bool constant_exprt::value_is_zero_string() const
2122
{
@@ -145,6 +146,7 @@ void object_descriptor_exprt::build(
145146
offset()=from_integer(0, index_type());
146147

147148
build_object_descriptor_rec(ns, expr, *this);
149+
simplify(offset(), ns);
148150
}
149151

150152
shift_exprt::shift_exprt(

0 commit comments

Comments
 (0)