From: Axel Naumann Date: Mon, 22 Sep 2014 19:23:58 +0000 (+0200) Subject: Degenerate floats cast to int can do amazing things. X-Git-Tag: v6-02-00-rc1~34 X-Git-Url: https://root.cern.ch/gitweb?p=root.git;a=commitdiff_plain;h=0e30aec98d00c19b7d110d3dcf8f13408252d051 Degenerate floats cast to int can do amazing things. --- diff --git a/math/mathcore/src/AdaptiveIntegratorMultiDim.cxx b/math/mathcore/src/AdaptiveIntegratorMultiDim.cxx index 85a61b8..2757150 100644 --- a/math/mathcore/src/AdaptiveIntegratorMultiDim.cxx +++ b/math/mathcore/src/AdaptiveIntegratorMultiDim.cxx @@ -345,6 +345,11 @@ L160: //to divide or not ctr[j] = wk[isbtmp]; wth[j] = wk[isbtmp-1]; } + if (idvax0 < 1) { + // Can happen for overflows / degenerate floats. + idvax0 = 1; + ::Error("AdaptiveIntegratorMultiDim::DoIntegral()", "Logic error: idvax0 < 1!"); + } wth[idvax0-1] = 0.5*wth[idvax0-1]; ctr[idvax0-1] -= wth[idvax0-1]; goto L20;