[ruby-talk:02348] Re: rb_catch

From: ts <decoux@...>
Date: 2000-04-03 10:48:20 UTC
List: ruby-talk #2348
>>>>> "Y" == Yukihiro Matsumoto <matz@netlab.co.jp> writes:

Y>  catch_i(tag)
Y>      ID tag;
Y>  {
Y> -    return rb_funcall(Qnil, rb_intern("catch"), 0, INT2FIX(tag));
Y> +    return rb_funcall(Qnil, rb_intern("catch"), 1, INT2FIX(tag));
Y>  }
 
 For 1.4.3, no ?


pigeon% diff -u eval.c~ eval.c
--- eval.c~     Tue Dec  7 17:47:15 1999
+++ eval.c      Mon Apr  3 12:43:58 2000
@@ -7548,7 +7548,7 @@
 catch_i(tag)
     ID tag;
 {
-    return rb_f_catch(0, FIX2INT(tag));
+    return rb_f_catch(0, INT2FIX(tag));
 }
 
 VALUE
pigeon% 

 It don't segfault with this patch.


pigeon% ~/ruby/ruby-1.4.3/ruby -e 'require "tt"'
/tmp/rbC1mo6e:1:in `require': yield called out of iterator (LocalJumpError)
        from /tmp/rbC1mo6e:1
pigeon% 


Guy Decoux

In This Thread