Browse Source

FoxGlynnWeights: Zero-initialise structure

Ensure that all members of the FoxGlynnWeights are zero-initialised,
in particular the pointer to the weights array.
master
Joachim Klein 8 years ago
committed by Dave Parker
parent
commit
5f40773fac
  1. 4
      prism/src/prism/prism.cc

4
prism/src/prism/prism.cc

@ -105,7 +105,9 @@ void release_string_array_from_java(JNIEnv *env, jstring *strings_jstrings, cons
EXPORT FoxGlynnWeights fox_glynn(double q_tmax, double underflow, double overflow, double accuracy)
{
FoxGlynnWeights fgw;
// construct result struct and zero-initialise
// this ensures that fgw.weights = nullptr in case we return early on error
FoxGlynnWeights fgw{};
if (q_tmax == 0.0) {
//FIXME: what should happen now?

Loading…
Cancel
Save