mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 1147491, part 2 - Disable use of BaseTimeDuration::operator/ with floating point values. r=ehsan
This commit is contained in:
parent
c08220d30e
commit
14ebbe252b
@ -86,7 +86,7 @@ public:
|
||||
T mean()
|
||||
{
|
||||
MOZ_ASSERT(!empty());
|
||||
return T(mTotal / mValues.length());
|
||||
return T(mTotal / int64_t(mValues.length()));
|
||||
}
|
||||
|
||||
bool empty()
|
||||
|
@ -181,6 +181,11 @@ private:
|
||||
// If required, use MultDouble explicitly and with care.
|
||||
BaseTimeDuration operator*(const double aMultiplier) const = delete;
|
||||
|
||||
// Block double divisor (for the same reason, and because dividing by
|
||||
// fractional values would otherwise invoke the int64_t variant, and rounding
|
||||
// the passed argument can then cause divide-by-zero) - Bug 1147491.
|
||||
BaseTimeDuration operator/(const double aDivisor) const = delete;
|
||||
|
||||
public:
|
||||
BaseTimeDuration MultDouble(double aMultiplier) const
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user