[Libreoffice-commits] core.git: sc/source

Libreoffice Gerrit user logerrit at kemper.freedesktop.org
Wed Dec 5 10:02:50 UTC 2018


 sc/source/core/opencl/op_math.cxx |    6 ++++++
 1 file changed, 6 insertions(+)

New commits:
commit 581c7e4a0ec50aaa13112985c7e79cd66628f997
Author:     Luboš Luňák <l.lunak at collabora.com>
AuthorDate: Tue Dec 4 12:58:11 2018 +0100
Commit:     Luboš Luňák <l.lunak at collabora.com>
CommitDate: Wed Dec 5 11:02:24 2018 +0100

    OpenCL SQRT() error checking
    
    Change-Id: I6208cf21f53d1a2a0eb4f08962c7bddcc372aab5
    Reviewed-on: https://gerrit.libreoffice.org/64545
    Tested-by: Jenkins
    Reviewed-by: Luboš Luňák <l.lunak at collabora.com>

diff --git a/sc/source/core/opencl/op_math.cxx b/sc/source/core/opencl/op_math.cxx
index 224c6480c3b5..4b34df551426 100644
--- a/sc/source/core/opencl/op_math.cxx
+++ b/sc/source/core/opencl/op_math.cxx
@@ -1278,6 +1278,10 @@ void OpSqrt::GenSlidingWindowFunction(std::stringstream &ss,
             ss << "    arg0=";
             ss << tmpCur->GetDouble() << ";\n";
         }
+        else
+        {
+            throw Unhandled( __FILE__, __LINE__ );
+        }
     }
     else
     {
@@ -1285,6 +1289,8 @@ void OpSqrt::GenSlidingWindowFunction(std::stringstream &ss,
         ss << vSubArguments[0]->GenSlidingWindowDeclRef();
         ss << ";\n";
     }
+    ss << "    if( arg0 < 0 )\n";
+    ss << "        return CreateDoubleError(IllegalArgument);\n";
     ss << "    return sqrt(arg0);\n";
     ss << "}";
 }


More information about the Libreoffice-commits mailing list