Skip to content

Commit

Permalink
Assert that the quotient and remainder references aren't this.
Browse files Browse the repository at this point in the history
Otherwise this gets zeroed and produces a wrong result.
  • Loading branch information
jralls committed Dec 4, 2014
1 parent f4c69db commit a993351
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/libqof/qof/qofint128.cpp
Expand Up @@ -625,6 +625,10 @@ QofInt128::div (const QofInt128& b, QofInt128& q, QofInt128& r) noexcept
r.m_flags |= NaN;
return;
}
assert (&q != this);
assert (&r != this);
assert (&q != &b);
assert (&r != &b);

q.zero(), r.zero();
if (b.isZero())
Expand Down

0 comments on commit a993351

Please sign in to comment.