svx/source/customshapes/EnhancedCustomShapeFunctionParser.cxx | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-)
New commits: commit 589de2407b8993f2b810e3c4bbaaab1185c1ea78 Author: Stephan Bergmann <stephan.bergm...@collabora.com> AuthorDate: Tue Aug 19 10:32:28 2025 +0200 Commit: Stephan Bergmann <stephan.bergm...@collabora.com> CommitDate: Wed Aug 20 09:04:38 2025 +0200 Reuse o3tl::div_allow_zero ...assuming that it was that single occurrence of "/" in BinaryFunctionExpression::getValue that prompted the __attribute__((no_sanitize("float-divide-by-zero"))) on that function in 6e4fc0508909af407e595d17b06a6b1d1cb36ba0 "ofz#3889 Divide-by-zero" Change-Id: If3fc6bd8811bb583b898aa6eaf67f30593ba7b72 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/189916 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <stephan.bergm...@collabora.com> diff --git a/svx/source/customshapes/EnhancedCustomShapeFunctionParser.cxx b/svx/source/customshapes/EnhancedCustomShapeFunctionParser.cxx index dcec13c136a0..f3ef252849bd 100644 --- a/svx/source/customshapes/EnhancedCustomShapeFunctionParser.cxx +++ b/svx/source/customshapes/EnhancedCustomShapeFunctionParser.cxx @@ -19,6 +19,7 @@ #include <sal/config.h> +#include <o3tl/safeint.hxx> #include <svx/EnhancedCustomShape2d.hxx> #include <rtl/ustring.hxx> #include <sal/log.hxx> @@ -467,10 +468,6 @@ public: mpSecondArg(std::move( xSecondArg )) { } -#if defined(__clang__) || defined (__GNUC__) - //GetEquationValueAsDouble calls isFinite on the result - __attribute__((no_sanitize("float-divide-by-zero"))) -#endif static double getValue( const ExpressionFunct eFunct, const std::shared_ptr<ExpressionNode>& rFirstArg, const std::shared_ptr<ExpressionNode>& rSecondArg ) { double fRet = 0; @@ -479,7 +476,7 @@ public: case ExpressionFunct::BinaryPlus : fRet = (*rFirstArg)() + (*rSecondArg)(); break; case ExpressionFunct::BinaryMinus: fRet = (*rFirstArg)() - (*rSecondArg)(); break; case ExpressionFunct::BinaryMul : fRet = (*rFirstArg)() * (*rSecondArg)(); break; - case ExpressionFunct::BinaryDiv : fRet = (*rFirstArg)() / (*rSecondArg)(); break; + case ExpressionFunct::BinaryDiv : fRet = o3tl::div_allow_zero((*rFirstArg)(), (*rSecondArg)()); break; case ExpressionFunct::BinaryMin : fRet = ::std::min( (*rFirstArg)(), (*rSecondArg)() ); break; case ExpressionFunct::BinaryMax : fRet = ::std::max( (*rFirstArg)(), (*rSecondArg)() ); break; case ExpressionFunct::BinaryAtan2: fRet = atan2( (*rFirstArg)(), (*rSecondArg)() ); break;