From: ts Date: 2004-08-31T17:54:56+09:00 Subject: Re: (Revised) [PATCH] Subtle bug in bignum.c >>>>> "M" == Markus writes: M> That makes sense (and I'd agree with the "really, really subtle M> assessment). So although my original patch "fixes" the problem, it does M> so in a way that is not obvious. Well, it fix the problem for *your* compiler and with *your* level of optimization, probably a more "smart" compiler will be able to optimize it and remove the variable from the register. You must see in rb_big_and() z = bignew(l2, RBIGNUM(x)->sign || RBIGNUM(y)->sign); zds = BDIGITS(z); for (i=0; isign) get2comp(z, Qfalse); return bignorm(z); that a "smart" compiler can see that `x' and `y' are not used (in this part) and remove these variables from the registers but if it do this, ruby will free BDIGITS(x) (i.e ds1) and BDIGITS(y) (i.e. ds2) and this why you see the bug. A patch is *perhaps* to don't give to the compiler the possibility to optimize these lines (hint "volatile") Guy Decoux