Assert that the quotient and remainder references aren't this.

Otherwise this gets zeroed and produces a wrong result.
This commit is contained in:
John Ralls 2014-11-29 13:23:18 -08:00
parent f4c69dbc48
commit a99335104f

View File

@ -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())