Skip to content

Commit

Permalink
Merge branch 'feature/shr' into develop
Browse files Browse the repository at this point in the history
  • Loading branch information
tell committed Oct 5, 2011
2 parents 7db9b2d + a9be35f commit 4acdaa7
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/mpint.cpp
Expand Up @@ -141,7 +141,7 @@ void MPInt::shr(MPInt& z, const MPInt& x, const size_t n)
} else {
assert(x_size > 0);

if (z.allocated_ < x.allocated_) {
if (z.allocated_ < x_size) {
z.allocated_ = x.allocated_;
z.d_ptr_.reset(new value_type[z.allocated_]);
}
Expand All @@ -156,7 +156,10 @@ void MPInt::shr(MPInt& z, const MPInt& x, const size_t n)
PUT(x.sign_size_);
PUT(move_shift);
#endif
bool lastIsZero = in_shr_shift(z.d_ptr_.get(), z.d_ptr_.get(), z.sign_size_, move_shift);
bool lastIsZero = false;
if (move_shift != 0) {
lastIsZero = in_shr_shift(z.d_ptr_.get(), z.d_ptr_.get(), z.sign_size_, move_shift);
}
#ifdef INSPECT
PUT(lastIsZero);
if (z.sign_size_ > 0) {
Expand Down

0 comments on commit 4acdaa7

Please sign in to comment.