@@ -122,7 +122,6 @@ static std::string architecture_string(T value, const char *s)
122
122
std::string (s) + " =" + std::to_string (value) + " ;\n " ;
123
123
}
124
124
125
- using max_alloc_sizet = uint64_t ;
126
125
// / The maximum allocation size is determined by the number of bits that
127
126
// / are left in the pointer of width \p pointer_width.
128
127
// /
@@ -137,7 +136,7 @@ using max_alloc_sizet = uint64_t;
137
136
// / \param pointer_width: The width of the pointer
138
137
// / \param object_bits : The number of bits used to represent the ID
139
138
// / \return The size in bytes of the maximum allocation supported.
140
- static max_alloc_sizet
139
+ static mp_integer
141
140
max_malloc_size (std::size_t pointer_width, std::size_t object_bits)
142
141
{
143
142
PRECONDITION (pointer_width >= 1 );
@@ -148,9 +147,7 @@ max_malloc_size(std::size_t pointer_width, std::size_t object_bits)
148
147
// but also down to -allocation_size, therefore the size is allowable
149
148
// is number of bits, less the signed bit.
150
149
const auto bits_for_positive_offset = offset_bits - 1 ;
151
- PRECONDITION (
152
- bits_for_positive_offset < std::numeric_limits<max_alloc_sizet>::digits);
153
- return ((max_alloc_sizet)1 ) << (max_alloc_sizet)bits_for_positive_offset;
150
+ return ((mp_integer)1 ) << (mp_integer)bits_for_positive_offset;
154
151
}
155
152
156
153
void ansi_c_internal_additions (std::string &code)
@@ -195,7 +192,7 @@ void ansi_c_internal_additions(std::string &code)
195
192
" int " CPROVER_PREFIX " malloc_failure_mode_assert_then_assume=" +
196
193
std::to_string (config.ansi_c .malloc_failure_mode_assert_then_assume )+" ;\n "
197
194
CPROVER_PREFIX " size_t " CPROVER_PREFIX " max_malloc_size=" +
198
- std::to_string (max_malloc_size (config.ansi_c .pointer_width , config
195
+ integer2string (max_malloc_size (config.ansi_c .pointer_width , config
199
196
.bv_encoding .object_bits ))+" ;\n "
200
197
201
198
// this is ANSI-C
0 commit comments