Skip to content

Commit 1b97d63

Browse files
committed
Use not-as-deprecated version of to_integer
1 parent e23a1bb commit 1b97d63

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/util/arith_tools.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,13 +10,13 @@ Author: Daniel Kroening, [email protected]
1010
#ifndef CPROVER_UTIL_ARITH_TOOLS_H
1111
#define CPROVER_UTIL_ARITH_TOOLS_H
1212

13+
#include "expr.h"
14+
#include "invariant.h"
1315
#include "mp_arith.h"
1416
#include "optional.h"
15-
#include "invariant.h"
1617

1718
#include "deprecate.h"
1819

19-
class exprt;
2020
class constant_exprt;
2121
class typet;
2222

@@ -49,7 +49,7 @@ struct numeric_castt<mp_integer> final
4949
optionalt<mp_integer> operator()(const exprt &expr) const
5050
{
5151
mp_integer out;
52-
if(to_integer(expr, out))
52+
if(expr.id() != ID_constant || to_integer(to_constant_expr(expr), out))
5353
return {};
5454
return out;
5555
}

0 commit comments

Comments
 (0)