Skip to content

Commit 00bf87c

Browse files
committed
simplify offset of string literal
1 parent d988fb1 commit 00bf87c

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

src/cprover/simplify_state_expr.cpp

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -594,6 +594,13 @@ exprt simplify_state_expr_node(
594594
return std::move(sum);
595595
}
596596
}
597+
else if(pointer_offset_expr.pointer().id() == ID_address_of)
598+
{
599+
const auto &address_of_expr =
600+
to_address_of_expr(pointer_offset_expr.pointer());
601+
if(address_of_expr.object().id() == ID_string_constant)
602+
return from_integer(0, pointer_offset_expr.type());
603+
}
597604
}
598605
else if(src.id() == ID_pointer_object)
599606
{

0 commit comments

Comments
 (0)