summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLuboš Luňák <l.lunak@collabora.com>2018-12-04 12:58:11 +0100
committerLuboš Luňák <l.lunak@collabora.com>2018-12-06 15:35:55 +0100
commitb6dbe0abef3e73f0f5c06073ccb8338831bf0522 (patch)
tree6112f7b8f08aa0e6f6c39c2f6e27bd653c2cea5e
parent8e409fb74b23c053effda4c892624548acc68903 (diff)
OpenCL SQRT() error checking
Change-Id: I6208cf21f53d1a2a0eb4f08962c7bddcc372aab5 Reviewed-on: https://gerrit.libreoffice.org/64545 Tested-by: Jenkins Reviewed-by: Luboš Luňák <l.lunak@collabora.com> (cherry picked from commit 581c7e4a0ec50aaa13112985c7e79cd66628f997) Reviewed-on: https://gerrit.libreoffice.org/64612
-rw-r--r--sc/source/core/opencl/op_math.cxx6
1 files changed, 6 insertions, 0 deletions
diff --git a/sc/source/core/opencl/op_math.cxx b/sc/source/core/opencl/op_math.cxx
index ec4a75daa9eb..41e6a5818166 100644
--- a/sc/source/core/opencl/op_math.cxx
+++ b/sc/source/core/opencl/op_math.cxx
@@ -1277,6 +1277,10 @@ void OpSqrt::GenSlidingWindowFunction(std::stringstream &ss,
ss << " arg0=";
ss << tmpCur->GetDouble() << ";\n";
}
+ else
+ {
+ throw Unhandled( __FILE__, __LINE__ );
+ }
}
else
{
@@ -1284,6 +1288,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 << "}";
}