Skip to content

Commit d197e6e

Browse files
authored
Merge pull request #3491 from tautschnig/use-value_is_zero_string
Refactoring: use value_is_zero_string
2 parents 549d138 + 039ef79 commit d197e6e

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

src/util/json_expr.cpp

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -37,12 +37,11 @@ static exprt simplify_json_expr(
3737

3838
if(type.id()==ID_pointer)
3939
{
40-
const irep_idt &value=to_constant_expr(src).get_value();
40+
const constant_exprt &c = to_constant_expr(src);
4141

4242
if(
43-
value != ID_NULL &&
44-
(value != std::string(value.size(), '0') ||
45-
!config.ansi_c.NULL_is_zero) &&
43+
c.get_value() != ID_NULL &&
44+
(!c.value_is_zero_string() || !config.ansi_c.NULL_is_zero) &&
4645
src.operands().size() == 1 &&
4746
to_unary_expr(src).op().id() != ID_constant)
4847
// try to simplify the constant pointer

0 commit comments

Comments
 (0)