@@ -122,7 +122,6 @@ static std::string architecture_string(T value, const char *s)
122122 std::string (s) + " =" + std::to_string (value) + " ;\n " ;
123123}
124124
125- using max_alloc_sizet = uint64_t ;
126125// / The maximum allocation size is determined by the number of bits that
127126// / are left in the pointer of width \p pointer_width.
128127// /
@@ -137,7 +136,7 @@ using max_alloc_sizet = uint64_t;
137136// / \param pointer_width: The width of the pointer
138137// / \param object_bits : The number of bits used to represent the ID
139138// / \return The size in bytes of the maximum allocation supported.
140- static max_alloc_sizet
139+ static mp_integer
141140max_malloc_size (std::size_t pointer_width, std::size_t object_bits)
142141{
143142 PRECONDITION (pointer_width >= 1 );
@@ -148,9 +147,7 @@ max_malloc_size(std::size_t pointer_width, std::size_t object_bits)
148147 // but also down to -allocation_size, therefore the size is allowable
149148 // is number of bits, less the signed bit.
150149 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;
154151}
155152
156153void ansi_c_internal_additions (std::string &code)
@@ -195,7 +192,7 @@ void ansi_c_internal_additions(std::string &code)
195192 " int " CPROVER_PREFIX " malloc_failure_mode_assert_then_assume=" +
196193 std::to_string (config.ansi_c .malloc_failure_mode_assert_then_assume )+" ;\n "
197194 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
199196 .bv_encoding .object_bits ))+" ;\n "
200197
201198 // this is ANSI-C
0 commit comments