Skip to content

Commit 726a92f

Browse files
committed
Store null-pointer-is-zero in pointer_logict
This keeps configurable aspects out of bv_pointerst.
1 parent ea5c3bc commit 726a92f

File tree

2 files changed

+9
-0
lines changed

2 files changed

+9
-0
lines changed

src/solvers/flattening/pointer_logic.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ Author: Daniel Kroening, [email protected]
1414
#include <util/arith_tools.h>
1515
#include <util/byte_operators.h>
1616
#include <util/c_types.h>
17+
#include <util/config.h>
1718
#include <util/invariant.h>
1819
#include <util/pointer_expr.h>
1920
#include <util/pointer_offset_size.h>
@@ -159,6 +160,8 @@ pointer_logict::pointer_logict(const namespacet &_ns):ns(_ns)
159160

160161
// add INVALID
161162
invalid_object=objects.number(exprt("INVALID"));
163+
164+
null_is_zero_address = config.ansi_c.NULL_is_zero;
162165
}
163166

164167
pointer_logict::~pointer_logict()

src/solvers/flattening/pointer_logic.h

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,9 +70,15 @@ class pointer_logict
7070

7171
void get_dynamic_objects(std::vector<std::size_t> &objects) const;
7272

73+
bool get_null_is_zero() const
74+
{
75+
return null_is_zero_address;
76+
}
77+
7378
protected:
7479
const namespacet &ns;
7580
std::size_t null_object, invalid_object;
81+
bool null_is_zero_address;
7682
};
7783

7884
#endif // CPROVER_SOLVERS_FLATTENING_POINTER_LOGIC_H

0 commit comments

Comments
 (0)