30
30
#include " interpreter_class.h"
31
31
#include " remove_returns.h"
32
32
33
- const size_t interpretert::npos=std::numeric_limits<size_t >::max();
33
+ const std:: size_t interpretert::npos=std::numeric_limits<size_t >::max();
34
34
35
35
void interpretert::operator ()()
36
36
{
@@ -392,7 +392,7 @@ void interpretert::execute_other()
392
392
mp_vectort tmp, rhs;
393
393
evaluate (pc->code .op1 (), tmp);
394
394
mp_integer address=evaluate_address (pc->code .op0 ());
395
- size_t size=get_size (pc->code .op0 ().type ());
395
+ std:: size_t size=get_size (pc->code .op0 ().type ());
396
396
while (rhs.size ()<size) rhs.insert (rhs.end (), tmp.begin (), tmp.end ());
397
397
if (size!=rhs.size ())
398
398
error () << " !! failed to obtain rhs (" << rhs.size () << " vs. "
@@ -419,7 +419,7 @@ void interpretert::execute_decl()
419
419
// / \par parameters: an object and a memory offset
420
420
struct_typet::componentt interpretert::get_component (
421
421
const irep_idt &object,
422
- unsigned offset)
422
+ std:: size_t offset)
423
423
{
424
424
const symbolt &symbol=ns.lookup (object);
425
425
const typet real_type=ns.follow (symbol.type );
@@ -468,7 +468,7 @@ exprt interpretert::get_value(
468
468
for (struct_typet::componentst::const_iterator it=components.begin ();
469
469
it!=components.end (); it++)
470
470
{
471
- size_t size=get_size (it->type ());
471
+ std:: size_t size=get_size (it->type ());
472
472
const exprt operand=get_value (it->type (), offset);
473
473
offset+=size;
474
474
result.copy_to_operands (operand);
@@ -480,7 +480,7 @@ exprt interpretert::get_value(
480
480
// Get size of array
481
481
exprt result=array_exprt (to_array_type (real_type));
482
482
const exprt &size_expr=static_cast <const exprt &>(type.find (ID_size));
483
- size_t subtype_size=get_size (type.subtype ());
483
+ std:: size_t subtype_size=get_size (type.subtype ());
484
484
std::size_t count;
485
485
if (size_expr.id ()!=ID_constant)
486
486
{
@@ -495,7 +495,7 @@ exprt interpretert::get_value(
495
495
496
496
// Retrieve the value for each member in the array
497
497
result.reserve_operands (count);
498
- for (unsigned i=0 ; i<count; i++)
498
+ for (std:: size_t i=0 ; i<count; i++)
499
499
{
500
500
const exprt operand=get_value (
501
501
type.subtype (),
@@ -533,7 +533,7 @@ exprt interpretert::get_value(
533
533
result.reserve_operands (components.size ());
534
534
for (const struct_union_typet::componentt &expr : components)
535
535
{
536
- size_t size=get_size (expr.type ());
536
+ std:: size_t size=get_size (expr.type ());
537
537
const exprt operand=get_value (expr.type (), rhs, offset);
538
538
offset+=size;
539
539
result.copy_to_operands (operand);
@@ -546,8 +546,9 @@ exprt interpretert::get_value(
546
546
const exprt &size_expr=static_cast <const exprt &>(type.find (ID_size));
547
547
548
548
// Get size of array
549
- size_t subtype_size=get_size (type.subtype ());
550
- unsigned count;
549
+ std::size_t subtype_size=get_size (type.subtype ());
550
+
551
+ std::size_t count;
551
552
if (unbounded_size (type))
552
553
{
553
554
count=base_address_to_actual_size (offset)/subtype_size;
@@ -556,12 +557,12 @@ exprt interpretert::get_value(
556
557
{
557
558
mp_integer mp_count;
558
559
to_integer (size_expr, mp_count);
559
- count=integer2unsigned (mp_count);
560
+ count=integer2size_t (mp_count);
560
561
}
561
562
562
563
// Retrieve the value for each member in the array
563
564
result.reserve_operands (count);
564
- for (unsigned i=0 ; i<count; i++)
565
+ for (std:: size_t i=0 ; i<count; i++)
565
566
{
566
567
const exprt operand=get_value (type.subtype (), rhs,
567
568
offset+i*subtype_size);
@@ -607,7 +608,7 @@ exprt interpretert::get_value(
607
608
// We want the symbol pointed to
608
609
std::size_t address=integer2size_t (rhs[offset]);
609
610
irep_idt identifier=address_to_identifier (address);
610
- size_t offset=address_to_offset (address);
611
+ std:: size_t offset=address_to_offset (address);
611
612
const typet type=get_type (identifier);
612
613
exprt symbol_expr (ID_symbol, type);
613
614
symbol_expr.set (ID_identifier, identifier);
@@ -656,7 +657,7 @@ void interpretert::execute_assign()
656
657
if (!rhs.empty ())
657
658
{
658
659
mp_integer address=evaluate_address (code_assign.lhs ());
659
- size_t size=get_size (code_assign.lhs ().type ());
660
+ std:: size_t size=get_size (code_assign.lhs ().type ());
660
661
661
662
if (size!=rhs.size ())
662
663
error () << " !! failed to obtain rhs ("
@@ -684,9 +685,9 @@ void interpretert::execute_assign()
684
685
side_effect_exprt side_effect=to_side_effect_expr (code_assign.rhs ());
685
686
if (side_effect.get_statement ()==ID_nondet)
686
687
{
687
- unsigned address=integer2unsigned (evaluate_address (code_assign.lhs ()));
688
- size_t size=get_size (code_assign.lhs ().type ());
689
- for (size_t i=0 ; i<size; i++)
688
+ std:: size_t address=integer2size_t (evaluate_address (code_assign.lhs ()));
689
+ std:: size_t size=get_size (code_assign.lhs ().type ());
690
+ for (std:: size_t i=0 ; i<size; i++)
690
691
{
691
692
memory[address+i].initialized =
692
693
memory_cellt::initializedt::READ_BEFORE_WRITTEN;
@@ -803,7 +804,7 @@ void interpretert::execute_function_call()
803
804
for (const auto &id : locals)
804
805
{
805
806
const symbolt &symbol=ns.lookup (id);
806
- frame.local_map [id]=integer2unsigned (build_memory_map (id, symbol.type ));
807
+ frame.local_map [id]=integer2size_t (build_memory_map (id, symbol.type ));
807
808
}
808
809
809
810
// assign the arguments
@@ -867,7 +868,7 @@ void interpretert::build_memory_map()
867
868
868
869
void interpretert::build_memory_map (const symbolt &symbol)
869
870
{
870
- size_t size=0 ;
871
+ std:: size_t size=0 ;
871
872
872
873
if (symbol.type .id ()==ID_code)
873
874
{
@@ -920,7 +921,7 @@ mp_integer interpretert::build_memory_map(
920
921
const typet &type)
921
922
{
922
923
typet alloc_type=concretize_type (type);
923
- size_t size=get_size (alloc_type);
924
+ std:: size_t size=get_size (alloc_type);
924
925
auto it=dynamic_types.find (id);
925
926
926
927
if (it!=dynamic_types.end ())
@@ -970,7 +971,7 @@ bool interpretert::unbounded_size(const typet &type)
970
971
// / get allocated 2^32 address space each (of a 2^64 sized space).
971
972
// / \param type: a structured type
972
973
// / \return Size of the given type
973
- size_t interpretert::get_size (const typet &type)
974
+ std:: size_t interpretert::get_size (const typet &type)
974
975
{
975
976
if (unbounded_size (type))
976
977
return 2ULL << 32ULL ;
@@ -980,7 +981,7 @@ size_t interpretert::get_size(const typet &type)
980
981
const struct_typet::componentst &components=
981
982
to_struct_type (type).components ();
982
983
983
- unsigned sum=0 ;
984
+ std:: size_t sum=0 ;
984
985
985
986
for (const auto &comp : components)
986
987
{
@@ -997,7 +998,7 @@ size_t interpretert::get_size(const typet &type)
997
998
const union_typet::componentst &components=
998
999
to_union_type (type).components ();
999
1000
1000
- size_t max_size=0 ;
1001
+ std:: size_t max_size=0 ;
1001
1002
1002
1003
for (const auto &comp : components)
1003
1004
{
@@ -1025,7 +1026,7 @@ size_t interpretert::get_size(const typet &type)
1025
1026
mp_integer size_mp;
1026
1027
bool ret=to_integer (size_const, size_mp);
1027
1028
CHECK_RETURN (!ret);
1028
- return subtype_size*integer2unsigned (size_mp);
1029
+ return subtype_size*integer2size_t (size_mp);
1029
1030
}
1030
1031
return subtype_size;
1031
1032
}
0 commit comments