Skip to content

Commit 1b5507f

Browse files
committed
fix format_expr formatter for pointer constants
This fixes the formatter for pointer-typed constant expressions.
1 parent 76d864c commit 1b5507f

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/util/format_expr.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -186,7 +186,9 @@ static std::ostream &format_rec(std::ostream &os, const constant_exprt &src)
186186
{
187187
if(is_null_pointer(src))
188188
return os << ID_NULL;
189-
else if(has_prefix(id2string(src.get_value()), "INVALID-"))
189+
else if(
190+
src.get_value() == "INVALID" ||
191+
has_prefix(id2string(src.get_value()), "INVALID-"))
190192
{
191193
return os << "INVALID-POINTER";
192194
}

0 commit comments

Comments
 (0)