[poincare] Avoid reading "garbage" value: result variable can be

read in the while condition without being set to an initial value
(if the first ridderApproximation was undefined for instance)

Found by clang-analyzer
This commit is contained in:
Émilie Feral
2020-11-05 10:19:32 +01:00
committed by LeaNumworks
parent d9b5acc70d
commit 5afdec00b8

View File

@@ -50,7 +50,7 @@ Evaluation<T> DerivativeNode::templatedApproximate(ApproximationContext approxim
}
T error = sizeof(T) == sizeof(double) ? DBL_MAX : FLT_MAX;
T result;
T result = 1.0;
T h = k_minInitialRate;
static T tenEpsilon = sizeof(T) == sizeof(double) ? 10.0*DBL_EPSILON : 10.0f*FLT_EPSILON;
do {