Re: [Libreoffice] [PATCH] fix for crash in math.cxx for std::numeric_limitsint::min

2011-12-13 Thread Stephan Bergmann
On 12/13/2011 12:15 AM, Markus Mohrhard wrote: diff --git a/sal/rtl/source/math.cxx b/sal/rtl/source/math.cxx index 947f733..d118dde 100644 --- a/sal/rtl/source/math.cxx +++ b/sal/rtl/source/math.cxx @@ -59,7 +59,7 @@ static double getN10Exp( int nExp ) { if ( nExp 0 ) { -if

Re: [Libreoffice] [PATCH] fix for crash in math.cxx for std::numeric_limitsint::min

2011-12-13 Thread Markus Mohrhard
Hello Kohei, I would be interested to know how to reproduce this crash.  Do you have a good way to reproduce this? Try fdo#43703 in master. This bug shows two problems. Firstly the problem in math.cxx and secondly as already done with

Re: [Libreoffice] [PATCH] fix for crash in math.cxx for std::numeric_limitsint::min

2011-12-13 Thread Kohei Yoshida
On Tue, 2011-12-13 at 07:33 +0100, Lionel Elie Mamane wrote: For a signed integer in twos complement, that is true, except for the smallest representable (negative) number; it stems from the asymmetry of the range. Thanks. I was aware of two's complement, but I just couldn't connect the dots

Re: [Libreoffice] [PATCH] fix for crash in math.cxx for std::numeric_limitsint::min

2011-12-13 Thread Eike Rathke
Hi Markus, On Tuesday, 2011-12-13 00:15:08 +0100, Markus Mohrhard wrote: the attached patch fixes a crash in our rtl::math lib. For std::numeric_limitsint::min() -nExp is the same as nExp and therefore we would be in the first case and try to access a non existing element. Good catch. As

[Libreoffice] [PATCH] fix for crash in math.cxx for std::numeric_limitsint::min

2011-12-12 Thread Markus Mohrhard
Hey, the attached patch fixes a crash in our rtl::math lib. For std::numeric_limitsint::min() -nExp is the same as nExp and therefore we would be in the first case and try to access a non existing element. Any objections against this patch? I think that this fix should be correct for all cases

Re: [Libreoffice] [PATCH] fix for crash in math.cxx for std::numeric_limitsint::min

2011-12-12 Thread Kohei Yoshida
Hi Markus, On Tue, 2011-12-13 at 00:15 +0100, Markus Mohrhard wrote: the attached patch fixes a crash in our rtl::math lib. For std::numeric_limitsint::min() -nExp is the same as nExp and therefore we would be in the first case and try to access a non existing element. I would be interested

Re: [Libreoffice] [PATCH] fix for crash in math.cxx for std::numeric_limitsint::min

2011-12-12 Thread Lionel Elie Mamane
On Tue, Dec 13, 2011 at 12:50:57AM -0500, Kohei Yoshida wrote: On Tue, 2011-12-13 at 00:15 +0100, Markus Mohrhard wrote: Any objections against this patch? I think that this fix should be correct for all cases but it would be good if someone could have a look at it. Well, I'm not