File tree Expand file tree Collapse file tree 1 file changed +3
-7
lines changed
Expand file tree Collapse file tree 1 file changed +3
-7
lines changed Original file line number Diff line number Diff line change @@ -444,7 +444,8 @@ bvt bv_pointerst::convert_pointer_type(const exprt &expr)
444444 count == 1 ,
445445 " there should be exactly one pointer-type operand in a pointer-type sum" );
446446
447- bvt sum=bv_utils.build_constant (0 , bits);
447+ const std::size_t offset_bits = bv_pointers_width.get_offset_width (type);
448+ bvt sum = bv_utils.build_constant (0 , offset_bits);
448449
449450 forall_operands (it, plus_expr)
450451 {
@@ -466,12 +467,7 @@ bvt bv_pointerst::convert_pointer_type(const exprt &expr)
466467 bvt op=convert_bv (*it);
467468 CHECK_RETURN (!op.empty ());
468469
469- // we cut any extra bits off
470-
471- if (op.size ()>bits)
472- op.resize (bits);
473- else if (op.size ()<bits)
474- op=bv_utils.extension (op, bits, rep);
470+ op = bv_utils.extension (op, offset_bits, rep);
475471
476472 sum=bv_utils.add (sum, op);
477473 }
You can’t perform that action at this time.
0 commit comments