[#8815] Segfault in libc strlen, via rb_str_new2 — "Sean E. Russell" <ser@...>

Howdy,

12 messages 2006/09/09
[#8817] Re: Segfault in libc strlen, via rb_str_new2 — Eric Hodel <drbrain@...7.net> 2006/09/09

On Sep 8, 2006, at 10:10 PM, Sean E. Russell wrote:

Re: [ ruby-Patches-5774 ] numeric.c fails to build on 64-bit platforms (Fedora Core 5 x86_64 gcc 4.1.1)

From: Tadashi Saito <shiba@...2.accsnet.ne.jp>
Date: 2006-09-18 16:32:23 UTC
List: ruby-core #8893
Hi all,

On Mon, 18 Sep 2006 12:03:15 +0900
Yukihiro Matsumoto <matz@ruby-lang.org> wrote:

> The patch has been merged.  Thanks.

Typo?

Index: numeric.c
===================================================================
RCS file: /src/ruby/numeric.c,v
retrieving revision 1.146
diff -u -p -r1.146 numeric.c
--- numeric.c   18 Sep 2006 03:17:06 -0000      1.146
+++ numeric.c   18 Sep 2006 16:31:44 -0000
@@ -1989,7 +1989,7 @@ fix_mul(VALUE x, VALUE y)
        if (FIXABLE(d)) return LONG2FIX(d);
        return rb_ll2inum(d);
 #else
-#      define SQRT_LONG_MAX ((SIZEOF_VALUE)1<<((SIZEOF_VALUE*CHAR_BIT-1)/2))
+#      define SQRT_LONG_MAX ((SIGNED_VALUE)1<<((SIZEOF_VALUE*CHAR_BIT-1)/2))
        /*tests if N*N would overflow*/
 #      define FIT_SQRT_LONG(n) (((n)<SQRT_LONG_MAX)&&((n)>=-SQRT_LONG_MAX))
        if (FIT_SQRT_LONG(a) && FIT_SQRT_LONG(b))

--
Tadashi Saito

In This Thread