Skip to content

Commit 7ac1554

Browse files
authored
Merge pull request diffblue#7705 from tautschnig/bugfixes/byte-extract-typing
Simplify byte extract: support signed and unsigned offsets
2 parents 5479b7c + 9df171e commit 7ac1554

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/util/simplify_expr.cpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1660,8 +1660,10 @@ simplify_exprt::simplify_byte_extract(const byte_extract_exprt &expr)
16601660
{
16611661
auto tmp = expr;
16621662

1663-
tmp.offset() = simplify_plus(
1664-
plus_exprt(to_byte_extract_expr(expr.op()).offset(), expr.offset()));
1663+
tmp.offset() = simplify_rec(plus_exprt(
1664+
typecast_exprt::conditional_cast(
1665+
to_byte_extract_expr(expr.op()).offset(), expr.offset().type()),
1666+
expr.offset()));
16651667
tmp.op() = to_byte_extract_expr(expr.op()).op();
16661668

16671669
return changed(simplify_byte_extract(tmp)); // recursive call

0 commit comments

Comments
 (0)