[#3726] Fixnum#clone and Float#clone raise different exceptions — "David A. Black" <dblack@...>

Hi --

15 messages 2004/11/12
[#3749] Re: Fixnum#clone and Float#clone raise different exceptions — "David A. Black" <dblack@...> 2004/11/16

Hi --

[#3751] Re: Fixnum#clone and Float#clone raise different exceptions — Yukihiro Matsumoto <matz@...> 2004/11/16

Hi,

[#3752] Re: Fixnum#clone and Float#clone raise different exceptions — "David A. Black" <dblack@...> 2004/11/16

Hi --

[#3785] The latest 1.8.2 cvs prints parse error when starting extension compiling — Yukihiro Matsumoto <matz@...>

Hi,

13 messages 2004/11/23
[#3787] Re: The latest 1.8.2 cvs prints parse error when starting extension compiling — Johan Holmberg <holmberg@...> 2004/11/23

Regexp: compile error vs. exception

From: Johan Holmberg <holmberg@...>
Date: 2004-11-16 22:54:51 UTC
List: ruby-core #3755
In recent CVS versions of Ruby 1.9 the behaviour of code like:

     Regexp.new("$*")

has changewd from

     test-regexp-new.rb:2:in `initialize': target of repeat operator is \
     invalid: /$*/ (RegexpError)
 	    from test-regexp-new.rb:2:in `new'
 	    from test-regexp-new.rb:2

to

     test-regexp-new-2.rb:2: target of repeat operator is invalid: /$*/


i.e. from an exception to a compile error. Isn't this wrong?

The patch below restores the old behaviour (if I understand the 
code correctly). Is the patch correct?

/Johan Holmberg

Index: re.c
===================================================================
RCS file: /src/ruby/re.c,v
retrieving revision 1.133
diff -u -r1.133 re.c
--- re.c	4 Nov 2004 14:43:08 -0000	1.133
+++ re.c	16 Nov 2004 22:38:18 -0000
@@ -1760,7 +1760,7 @@
  	s = StringValuePtr(argv[0]);
  	len = RSTRING(argv[0])->len;
      }
-    rb_reg_initialize(self, s, len, flags, Qtrue);
+    rb_reg_initialize(self, s, len, flags, Qfalse);
      return self;
  }


In This Thread

Prev Next