Skip to content

Commit 3c9225c

Browse files
committed
Replace deprecated to_integer with numeric_cast
1 parent dba7ec9 commit 3c9225c

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
@@ -23,9 +23,9 @@ bvt bv_cbmct::convert_waitfor(const exprt &expr)
2323
const exprt &predicate=expr.op3();
2424
const exprt new_cycle = make_free_bv_expr(expr.type());
2525

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

3030
{
3131
// constraint: new_cycle>=old_cycle

0 commit comments

Comments
 (0)