@@ -615,10 +615,10 @@ literalt bv_utilst::overflow_negate(const bvt &bv)
615615 // a overflow on unary- can only happen with the smallest
616616 // representable number 100....0
617617
618- bvt zeros (bv);
619- zeros. erase (--zeros. end () );
618+ bvt should_be_zeros (bv);
619+ should_be_zeros. pop_back ( );
620620
621- return prop.land (bv[bv.size ()- 1 ], !prop.lor (zeros ));
621+ return prop.land (bv[bv.size () - 1 ], !prop.lor (should_be_zeros ));
622622}
623623
624624void bv_utilst::incrementer (
@@ -715,13 +715,9 @@ bvt bv_utilst::unsigned_multiplier(const bvt &_op0, const bvt &_op1)
715715 for (std::size_t sum=0 ; sum<op0.size (); sum++)
716716 if (op0[sum]!=const_literal (false ))
717717 {
718- bvt tmpop;
719-
718+ bvt tmpop = zeros (sum);
720719 tmpop.reserve (op0.size ());
721720
722- for (std::size_t idx=0 ; idx<sum; idx++)
723- tmpop.push_back (const_literal (false ));
724-
725721 for (std::size_t idx=sum; idx<op0.size (); idx++)
726722 tmpop.push_back (prop.land (op1[idx-sum], op0[sum]));
727723
@@ -746,13 +742,9 @@ bvt bv_utilst::unsigned_multiplier(const bvt &_op0, const bvt &_op1)
746742 for(std::size_t bit=0; bit<op0.size(); bit++)
747743 if(op0[bit]!=const_literal(false))
748744 {
749- bvt pp;
750-
751- pp.reserve(op0.size());
752-
753745 // zeros according to weight
754- for(std::size_t idx=0; idx< bit; idx++)
755- pp.push_back(const_literal(false ));
746+ bvt pp = zeros( bit);
747+ pp.reserve(op0.size( ));
756748
757749 for(std::size_t idx=bit; idx<op0.size(); idx++)
758750 pp.push_back(prop.land(op1[idx-bit], op0[bit]));
0 commit comments