[#7955] Failing tests in ruby since 1.8.2 — "Caleb Tennis" <caleb@...>
The following tests have been failing in Ruby for a long time, including
[#7978] Patch for Unix socket peer credentials — "James F. Hranicky" <jfh@...>
This patch adds support for getting the uid and gid of the peer
In article <200606091528.30171.jfh@cise.ufl.edu>,
On Friday 16 June 2006 11:51, Tanaka Akira wrote:
In article <200606161327.35948.jfh@cise.ufl.edu>,
On Saturday 17 June 2006 06:27, Tanaka Akira wrote:
In article <200607101352.16804.jfh@cise.ufl.edu>,
On Tuesday 11 July 2006 00:10, Tanaka Akira wrote:
Hi,
On Thursday 13 July 2006 22:48, nobu@ruby-lang.org wrote:
On Jul 18, 2006, at 12:27 PM, James F. Hranicky wrote:
On Tuesday 18 July 2006 15:52, Eric Hodel wrote:
[#7994] Ruby Kaigi date confusion — "Charles O Nutter" <headius@...>
I'm quite confused by the dates I have seen reported on various Ruby Kaigi
[#8013] Download page on ruby-lang has numeric URL — Hugh Sasse <hgs@...>
This is off-topic to ruby-core, but possibly core to ruby's uptake:
On Jun 19, 2006, at 3:32 AM, Hugh Sasse wrote:
[#8038] bug in $. ? — Wybo Dekker <wybo@...>
wybo>cat t
Wybo Dekker schrieb:
Pit Capitain wrote:
[#8050] Thank-you to the Rails Core Team — Dave Teare <devlists-ruby-core@...>
While we were listening to Dave Thomas' Keynote address today at
[#8061] Win32 Extension Issues Wanted! — "Austin Ziegler" <halostatue@...>
Everyone. I had a conversation with folks from Microsoft today about
[#8065] Core documentation patches — Alex Young <alex@...>
Hi there,
Hi,
Yukihiro Matsumoto wrote:
[#8073] 1.8.5p1 build failure on Solaris 10 — "Daniel Berger" <Daniel.Berger@...>
Solaris 10
Hi,
Yukihiro Matsumoto wrote:
>>>>> "D" == Daniel Berger <Daniel.Berger@qwest.com> writes:
ts <decoux@moulon.inra.fr> wrote on 28.06.2006 17:37:00:
Hi,
Yukihiro Matsumoto <matz@ruby-lang.org> wrote on 29.06.2006 20:02:11:
Hi,
Yukihiro Matsumoto <matz@ruby-lang.org> wrote on 29.06.2006 20:53:20:
ville.mattila@stonesoft.com wrote:
[#8087] optparse.rb to RDoc documentation patch — <noreply@...>
Patches item #4879, was opened at 2006-06-28 20:50
On Jun 28, 2006, at 11:50 AM, <noreply@rubyforge.org>
[#8102] Reorganizing configure.in by platform? — "Daniel Berger" <Daniel.Berger@...>
Hi,
[PATCH] rb_iterate_proc()
Hi, the attached patch adds the function rb_iterate_proc() to eval.c (latest stable). It works like rb_iterate(), but takes a Proc object instead of bl_proc and data2. It allows to call methods like instance_eval and define_method with a block argument from a C extension. Could this please be applied for Ruby 1.8.5 (and also 1.9). It has been requested at least three times on ruby-talk recently and it would be very useful for my Ruby2CExtension project. Dominik
Attachments (1)
diff -ruw ruby_stable_20060619/eval.c ruby_stable_it_proc/eval.c
--- ruby_stable_20060619/eval.c 2006-06-07 02:19:11.000000000 +0200
+++ ruby_stable_it_proc/eval.c 2006-06-19 02:16:37.000000000 +0200
@@ -5284,6 +5284,87 @@
return retval;
}
+static void proc_set_safe_level _((VALUE));
+static int block_orphan _((struct BLOCK*));
+static VALUE block_pass_proc_check _((VALUE));
+
+VALUE
+rb_iterate_proc(it_proc, data1, proc)
+ VALUE (*it_proc) _((VALUE));
+ VALUE data1, proc;
+{
+ struct BLOCK * volatile old_block;
+ struct BLOCK _block;
+ struct BLOCK *data;
+ int state;
+ volatile VALUE retval = Qnil;
+ volatile int orphan;
+ volatile int safe = ruby_safe_level;
+
+ if (NIL_P(proc)) {
+ PUSH_ITER(ITER_NOT);
+ retval = (*it_proc)(data1);
+ POP_ITER();
+ return retval;
+ }
+
+ proc = block_pass_proc_check(proc);
+
+ if (ruby_block && ruby_block->block_obj == proc) {
+ PUSH_ITER(ITER_PAS);
+ retval = (*it_proc)(data1);
+ POP_ITER();
+ return retval;
+ }
+
+ Data_Get_Struct(proc, struct BLOCK, data);
+ orphan = block_orphan(data);
+
+ /* PUSH BLOCK from data */
+ old_block = ruby_block;
+ _block = *data;
+ _block.outer = ruby_block;
+ if (orphan) _block.uniq = block_unique++;
+ ruby_block = &_block;
+ PUSH_ITER(ITER_PRE);
+ if (ruby_frame->iter == ITER_NOT)
+ ruby_frame->iter = ITER_PRE;
+
+ PUSH_TAG(PROT_LOOP);
+ state = EXEC_TAG();
+ if (state == 0) {
+ iter_retry:
+ proc_set_safe_level(proc);
+ if (safe > ruby_safe_level)
+ ruby_safe_level = safe;
+ retval = (*it_proc)(data1);
+ }
+ else if (state == TAG_BREAK && TAG_DST()) {
+ retval = prot_tag->retval;
+ state = 0;
+ }
+ else if (state == TAG_RETRY) {
+ state = 0;
+ goto iter_retry;
+ }
+ POP_TAG();
+ POP_ITER();
+ ruby_block = old_block;
+ ruby_safe_level = safe;
+
+ switch (state) {/* escape from orphan block */
+ case 0:
+ break;
+ case TAG_RETURN:
+ if (orphan) {
+ proc_jump_error(state, prot_tag->retval);
+ }
+ default:
+ JUMP_TAG(state);
+ }
+ return retval;
+}
+
static int
handle_rescue(self, node)
VALUE self;
@@ -8722,12 +8803,33 @@
}
static VALUE
+block_pass_proc_check(proc)
+ VALUE proc;
+{
+ VALUE b;
+ if (!rb_obj_is_proc(proc)) {
+ b = rb_check_convert_type(proc, T_DATA, "Proc", "to_proc");
+ if (!rb_obj_is_proc(b)) {
+ rb_raise(rb_eTypeError, "wrong argument type %s (expected Proc)",
+ rb_obj_classname(proc));
+ }
+ proc = b;
+ }
+
+ if (ruby_safe_level >= 1 && OBJ_TAINTED(proc) &&
+ ruby_safe_level > proc_get_safe_level(proc)) {
+ rb_raise(rb_eSecurityError, "Insecure: tainted block value");
+ }
+
+ return proc;
+}
+
+static VALUE
block_pass(self, node)
VALUE self;
NODE *node;
{
VALUE proc = rb_eval(self, node->nd_body); /* OK */
- VALUE b;
struct BLOCK * volatile old_block;
struct BLOCK _block;
struct BLOCK *data;
@@ -8742,19 +8844,8 @@
POP_ITER();
return result;
}
- if (!rb_obj_is_proc(proc)) {
- b = rb_check_convert_type(proc, T_DATA, "Proc", "to_proc");
- if (!rb_obj_is_proc(b)) {
- rb_raise(rb_eTypeError, "wrong argument type %s (expected Proc)",
- rb_obj_classname(proc));
- }
- proc = b;
- }
- if (ruby_safe_level >= 1 && OBJ_TAINTED(proc) &&
- ruby_safe_level > proc_get_safe_level(proc)) {
- rb_raise(rb_eSecurityError, "Insecure: tainted block value");
- }
+ proc = block_pass_proc_check(proc);
if (ruby_block && ruby_block->block_obj == proc) {
PUSH_ITER(ITER_PAS);
diff -ruw ruby_stable_20060619/ruby.h ruby_stable_it_proc/ruby.h
--- ruby_stable_20060619/ruby.h 2006-06-14 16:10:39.000000000 +0200
+++ ruby_stable_it_proc/ruby.h 2006-06-19 01:55:51.000000000 +0200
@@ -557,6 +557,7 @@
int rb_block_given_p _((void));
void rb_need_block _((void));
VALUE rb_iterate _((VALUE(*)(VALUE),VALUE,VALUE(*)(ANYARGS),VALUE));
+VALUE rb_iterate_proc _((VALUE(*)(VALUE),VALUE,VALUE));
VALUE rb_rescue _((VALUE(*)(ANYARGS),VALUE,VALUE(*)(ANYARGS),VALUE));
VALUE rb_rescue2 __((VALUE(*)(ANYARGS),VALUE,VALUE(*)(ANYARGS),VALUE,...));
VALUE rb_ensure _((VALUE(*)(ANYARGS),VALUE,VALUE(*)(ANYARGS),VALUE));