Skip to content

Commit f06cbea

Browse files
committed
Replace deprecated to_integer with numeric_cast
1 parent 017c1b0 commit f06cbea

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/cbmc/bv_cbmc.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,9 @@ bvt bv_cbmct::convert_waitfor(const exprt &expr)
2424
const exprt &predicate=expr.op3();
2525
const exprt new_cycle = make_free_bv_expr(expr.type());
2626

27-
mp_integer bound_value;
28-
bool successful_cast = to_integer(bound, bound_value);
29-
INVARIANT(successful_cast, "waitfor bound must be a constant");
27+
optionalt<mp_integer> bound_converted = numeric_cast<mp_integer>(bound);
28+
INVARIANT(bound_converted.has_value(), "waitfor bound must be a constant");
29+
mp_integer bound_value = bound_converted.value();
3030

3131
{
3232
// constraint: new_cycle>=old_cycle

0 commit comments

Comments
 (0)