summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2016-08-17 15:10:59 +0100
committerCaolán McNamara <caolanm@redhat.com>2016-08-17 15:58:57 +0100
commit34d7a1d9bf0866b9dddb684e723d9f1e5e9a3697 (patch)
treea8045e9f4a819b54a0a4f8ab0875d8c6a0131328
parentebe4259437254123697d6d62a4475f112efff31c (diff)
revert div by 0 ubsan hackarounds now
Change-Id: I6497a87d3071f91d5465033d2dc6ecafaa6461f4 Revert "use div() instead of /0 to content ubsan" This reverts commit fa293f7d6792a2beab048461c8a067e9ca980bb8. Revert "use div() instead of /0 to content ubsan" This reverts commit e043cce9a48c1e4f4dd232a58de64f03d1d3919f. Revert "use div() instead of /0 to content ubsan" This reverts commit ebe04c075649c677b55941e3b4e57fbca150b5db. Revert "use div() instead of /0 to content ubsan" This reverts commit fb2c146752074b132d665e40343a08dcb2e6672e.
-rw-r--r--sc/source/core/tool/interpr1.cxx12
-rw-r--r--sc/source/core/tool/interpr2.cxx8
-rw-r--r--solenv/sanitizers/ubsan-suppressions1
3 files changed, 11 insertions, 10 deletions
diff --git a/sc/source/core/tool/interpr1.cxx b/sc/source/core/tool/interpr1.cxx
index bec54db19b56..52db34123cb1 100644
--- a/sc/source/core/tool/interpr1.cxx
+++ b/sc/source/core/tool/interpr1.cxx
@@ -1697,7 +1697,7 @@ void ScInterpreter::ScTan()
void ScInterpreter::ScCot()
{
- PushDouble(div(1.0, ::rtl::math::tan(GetDouble())));
+ PushDouble(1.0 / ::rtl::math::tan(GetDouble()));
}
void ScInterpreter::ScArcSin()
@@ -1737,7 +1737,7 @@ void ScInterpreter::ScTanHyp()
void ScInterpreter::ScCotHyp()
{
- PushDouble(div(1.0, tanh(GetDouble())));
+ PushDouble(1.0 / tanh(GetDouble()));
}
void ScInterpreter::ScArcSinHyp()
@@ -1774,22 +1774,22 @@ void ScInterpreter::ScArcCotHyp()
void ScInterpreter::ScCosecant()
{
- PushDouble(div(1.0, ::rtl::math::sin(GetDouble())));
+ PushDouble(1.0 / ::rtl::math::sin(GetDouble()));
}
void ScInterpreter::ScSecant()
{
- PushDouble(div(1.0, ::rtl::math::cos(GetDouble())));
+ PushDouble(1.0 / ::rtl::math::cos(GetDouble()));
}
void ScInterpreter::ScCosecantHyp()
{
- PushDouble(div(1.0, sinh(GetDouble())));
+ PushDouble(1.0 / sinh(GetDouble()));
}
void ScInterpreter::ScSecantHyp()
{
- PushDouble(div(1.0, cosh(GetDouble())));
+ PushDouble(1.0 / cosh(GetDouble()));
}
void ScInterpreter::ScExp()
diff --git a/sc/source/core/tool/interpr2.cxx b/sc/source/core/tool/interpr2.cxx
index 37d84650215a..658119848879 100644
--- a/sc/source/core/tool/interpr2.cxx
+++ b/sc/source/core/tool/interpr2.cxx
@@ -1883,11 +1883,11 @@ double ScInterpreter::ScGetRmz(double fRate, double fNper, double fPv,
else
{
if (bPayInAdvance) // payment in advance
- fPayment = div((fFv + fPv * exp( fNper * ::rtl::math::log1p(fRate) ) ) * fRate,
- (::rtl::math::expm1( (fNper + 1) * ::rtl::math::log1p(fRate) ) - fRate));
+ fPayment = (fFv + fPv * exp( fNper * ::rtl::math::log1p(fRate) ) ) * fRate /
+ (::rtl::math::expm1( (fNper + 1) * ::rtl::math::log1p(fRate) ) - fRate);
else // payment in arrear
- fPayment = div((fFv + fPv * exp(fNper * ::rtl::math::log1p(fRate) ) ) * fRate,
- ::rtl::math::expm1( fNper * ::rtl::math::log1p(fRate) ));
+ fPayment = (fFv + fPv * exp(fNper * ::rtl::math::log1p(fRate) ) ) * fRate /
+ ::rtl::math::expm1( fNper * ::rtl::math::log1p(fRate) );
}
return -fPayment;
}
diff --git a/solenv/sanitizers/ubsan-suppressions b/solenv/sanitizers/ubsan-suppressions
index 529f77c1429a..05adbd33ef06 100644
--- a/solenv/sanitizers/ubsan-suppressions
+++ b/solenv/sanitizers/ubsan-suppressions
@@ -13,6 +13,7 @@
# UBSAN_OPTIONS environment variable (and making sure to compile with
# -fsanitize-recover=float-divide-by-zero):
+float-divide-by-zero:sc/source/core/tool/interpr1.cxx
float-divide-by-zero:sc/source/core/tool/interpr2.cxx
float-divide-by-zero:scaddins/source/analysis/analysis.cxx
float-divide-by-zero:scaddins/source/analysis/financial.cxx