Skip to content

Commit

Permalink
is_null_pointer: remove code path that is no longer necessary
Browse files Browse the repository at this point in the history
It seems all front-ends have been updated.
  • Loading branch information
tautschnig committed Sep 10, 2024
1 parent 42b70b2 commit 7b47e9f
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions src/util/std_expr.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,16 +30,12 @@ bool constant_exprt::is_null_pointer() const
if(get_value() == ID_NULL)
return true;

// We used to support "0" (when NULL_is_zero), but really front-ends should
// resolve this and generate ID_NULL instead.
#if 0
return config.ansi_c.NULL_is_zero && value_is_zero_string();
#else
// We used to support "0" (when NULL_is_zero), but really front-ends should
// resolve this and generate ID_NULL instead.
INVARIANT(
!value_is_zero_string() || !config.ansi_c.NULL_is_zero,
"front-end should use ID_NULL");
return false;

Check warning on line 38 in src/util/std_expr.cpp

View check run for this annotation

Codecov / codecov/patch

src/util/std_expr.cpp#L38

Added line #L38 was not covered by tests
#endif
}

void constant_exprt::check(const exprt &expr, const validation_modet vm)
Expand Down

0 comments on commit 7b47e9f

Please sign in to comment.