Skip to content

Commit 48bfc7e

Browse files
author
Pascal Kesseli
committed
expr2c: Allow custom __CPROVER_fixedbv types together with double/float when using --fixedbv.
1 parent 7a5a1e0 commit 48bfc7e

File tree

1 file changed

+5
-10
lines changed

1 file changed

+5
-10
lines changed

src/ansi-c/expr2c.cpp

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -276,24 +276,19 @@ std::string expr2ct::convert_rec(
276276
}
277277
else if(src.id()==ID_fixedbv)
278278
{
279-
std::size_t width=to_fixedbv_type(src).get_width();
279+
const std::size_t width=to_fixedbv_type(src).get_width();
280280

281281
if(config.ansi_c.use_fixed_for_float)
282282
{
283283
if(width==config.ansi_c.single_width)
284284
return q+"float"+d;
285-
else if(width==config.ansi_c.double_width)
285+
if(width==config.ansi_c.double_width)
286286
return q+"double"+d;
287-
else if(width==config.ansi_c.long_double_width)
287+
if(width==config.ansi_c.long_double_width)
288288
return q+"long double"+d;
289-
else
290-
assert(false);
291-
}
292-
else
293-
{
294-
std::size_t fraction_bits=to_fixedbv_type(src).get_fraction_bits();
295-
return q+"__CPROVER_fixedbv["+i2string(width)+"]["+i2string(fraction_bits)+"]";
296289
}
290+
const std::size_t fraction_bits=to_fixedbv_type(src).get_fraction_bits();
291+
return q+"__CPROVER_fixedbv["+i2string(width)+"]["+i2string(fraction_bits)+"]"+d;
297292
}
298293
else if(src.id()==ID_c_bit_field)
299294
{

0 commit comments

Comments
 (0)