File tree Expand file tree Collapse file tree 3 files changed +10
-3
lines changed
regression/cbmc/assigning_nullpointers_should_not_crash_symex Expand file tree Collapse file tree 3 files changed +10
-3
lines changed Original file line number Diff line number Diff line change 11#include <assert.h>
2- #include <stddef .h>
2+ #include <stdlib .h>
33
44struct linked_list
55{
Original file line number Diff line number Diff line change 1- KNOWNBUG
1+ CORE
22main.c
33
44^EXIT=0$
Original file line number Diff line number Diff line change @@ -1740,7 +1740,7 @@ optionalt<std::string> simplify_exprt::expr2bits(
17401740 if (
17411741 type.id () == ID_unsignedbv || type.id () == ID_signedbv ||
17421742 type.id () == ID_floatbv || type.id () == ID_fixedbv ||
1743- type.id () == ID_c_bit_field || type. id () == ID_pointer )
1743+ type.id () == ID_c_bit_field)
17441744 {
17451745 const auto width = to_bitvector_type (type).get_width ();
17461746
@@ -1753,6 +1753,13 @@ optionalt<std::string> simplify_exprt::expr2bits(
17531753
17541754 return result;
17551755 }
1756+ else if (type.id () == ID_pointer)
1757+ {
1758+ if (value == ID_NULL && config.ansi_c .NULL_is_zero )
1759+ return std::string (' 0' , to_bitvector_type (type).get_width ());
1760+ else
1761+ return {};
1762+ }
17561763 else if (type.id () == ID_c_enum_tag)
17571764 {
17581765 const auto &c_enum_type = ns.follow_tag (to_c_enum_tag_type (type));
You can’t perform that action at this time.
0 commit comments