[#4745] Win32: Ruby & APR; build problems for Ruby Subversion SWIG bindings — Erik Huelsmann <ehuels@...>

Having taken upon me the task to provide a Windows build for

24 messages 2005/04/20
[#4746] Re: Win32: Ruby & APR; build problems for Ruby Subversion SWIG bindings — Austin Ziegler <halostatue@...> 2005/04/20

On 4/20/05, Erik Huelsmann <ehuels@gmail.com> wrote:

[#4747] Re: Win32: Ruby & APR; build problems for Ruby Subversion SWIG bindings — Erik Huelsmann <ehuels@...> 2005/04/20

Hi Austin,

[#4762] Re: Win32: Ruby & APR; build problems for Ruby Subversion SWIG bindings — nobu.nokada@... 2005/04/24

Hi,

[#4783] Re: Win32: Ruby & APR; build problems for Ruby Subversion SWIG bindings — Erik Huelsmann <ehuels@...> 2005/04/25

On 4/24/05, nobu.nokada@softhome.net <nobu.nokada@softhome.net> wrote:

[#4787] Re: Win32: Ruby & APR; build problems for Ruby Subversion SWIG bindings — nobu.nokada@... 2005/04/25

Hi,

[#4794] Re: Win32: Ruby & APR; build problems for Ruby Subversion SWIG bindings — Erik Huelsmann <ehuels@...> 2005/04/25

> > > Ruby is just using AC_TYPE_UID_T. So, using typedef for them,

[#4751] Illegal regexp causes segfault — Andrew Walrond <andrew@...>

irb(main):058:0> a = /\[([^]]*)\]/

13 messages 2005/04/22

[ ruby-Bugs-1823 ] NUM2UINT does not rase RangError for negative Fixnum

From: noreply@...
Date: 2005-04-22 18:41:01 UTC
List: ruby-core #4753
Bugs item #1823, was opened at 2005-04-22 11:34
You can respond by visiting: 
http://rubyforge.org/tracker/?func=detail&atid=1698&aid=1823&group_id=426

Category: None
Group: None
Status: Open
Resolution: None
Priority: 5
Submitted By: Michael Schonberg (mschonberg)
Assigned to: Nobody (None)
Summary: NUM2UINT does not rase RangError for negative Fixnum

Initial Comment:
NUM2UINT does not rase RangError for negative Fixnum. If a Fixnum is < 0, NUM2UINT(value) should raise a RangeError since an unsigned int can not be negative. 

Adding the following to my code fixed the problem:
    if( FIXNUM_P(val) && ( val & 0x04000000 ) )
    {
        rb_raise( rb_eRangeError, "unsigned int can not be less than 0" );
    }

I believe that changing rb_num2ulong to:

    unsigned long
    rb_num2ulong(val)
        VALUE val;
    {
        if (TYPE(val) == T_BIGNUM) {
	    return rb_big2ulong(val);
        }
        else if (FIXNUM_P(val) && (val & 0x04000000)) {
            rb_raise(rb_eRangeError, "unsigned int can not be < 0")
        }
        return (unsigned long)rb_num2long(val);
    }
in numeric.c will fix the problem. I am not certain if the same problem exists when SIZEOF_INT < SIZEOF_LONG.

----------------------------------------------------------------------

You can respond by visiting: 
http://rubyforge.org/tracker/?func=detail&atid=1698&aid=1823&group_id=426

In This Thread

Prev Next