* io.c (rb_f_syscall): type dispatch should be based on
rb_check_string_type(), not FIXNUM_P(), because values may be a bignum. [ruby-talk:72257] * eval.c (rb_call0): should pass the current klass value to block_invoke, which may be called via "super". [ruby-core:01077] * eval.c (block_invoke): now takes 4th argument "klass". * eval.c (block_alloc): should propagate BLOCK_PROC to ruby_block. * marshal.c (r_object0): should not use "yield" method, use "call" instead. (ruby-bugs-ja PR#476) git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@3886 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
045eb9773e
commit
979f006b9e
33
ChangeLog
33
ChangeLog
@ -5,6 +5,11 @@ Fri May 30 22:28:04 2003 Nobuyoshi Nakada <nobu.nokada@softhome.net>
|
|||||||
|
|
||||||
* ruby.h (NUM2UINT, FIX2INT): ditto.
|
* ruby.h (NUM2UINT, FIX2INT): ditto.
|
||||||
|
|
||||||
|
Fri May 30 15:01:05 2003 why the lucky stiff <ruby-cvs@whytheluckystiff.net>
|
||||||
|
|
||||||
|
* ext/syck/token.c: preserve any indentation passed an explicit
|
||||||
|
indentation.
|
||||||
|
|
||||||
Fri May 30 14:55:44 2003 Nobuyoshi Nakada <nobu.nokada@softhome.net>
|
Fri May 30 14:55:44 2003 Nobuyoshi Nakada <nobu.nokada@softhome.net>
|
||||||
|
|
||||||
* eval.c (rb_Array): exclude Kernel#to_a instead of Object#to_a.
|
* eval.c (rb_Array): exclude Kernel#to_a instead of Object#to_a.
|
||||||
@ -18,12 +23,7 @@ Fri May 30 14:55:44 2003 Nobuyoshi Nakada <nobu.nokada@softhome.net>
|
|||||||
* lib/optparse.rb (OptionParser::Switch::PlacedArgument#parse):
|
* lib/optparse.rb (OptionParser::Switch::PlacedArgument#parse):
|
||||||
override next switch after argument conversion.
|
override next switch after argument conversion.
|
||||||
|
|
||||||
Fri May 30 00:01:05 2003 why the lucky stiff <ruby-cvs@whytheluckystiff.net>
|
Fri May 30 14:41:34 2003 why the lucky stiff <ruby-cvs@whytheluckystiff.net>
|
||||||
|
|
||||||
* ext/syck/token.c: preserve any indentation passed an explicit
|
|
||||||
indentation.
|
|
||||||
|
|
||||||
Thu May 29 23:41:34 2003 why the lucky stiff <ruby-cvs@whytheluckystiff.net>
|
|
||||||
|
|
||||||
* ext/syck/handler.c, ext/syck/syck.h: removed syck_fold_format().
|
* ext/syck/handler.c, ext/syck/syck.h: removed syck_fold_format().
|
||||||
|
|
||||||
@ -71,6 +71,12 @@ Thu May 29 09:11:01 2003 Nobuyoshi Nakada <nobu.nokada@softhome.net>
|
|||||||
* lib/optparse.rb (OptionParser::Switch::PlacedArgument::parse):
|
* lib/optparse.rb (OptionParser::Switch::PlacedArgument::parse):
|
||||||
do not treat unmatched argument as an option.
|
do not treat unmatched argument as an option.
|
||||||
|
|
||||||
|
Wed May 28 08:44:26 2003 Yukihiro Matsumoto <matz@ruby-lang.org>
|
||||||
|
|
||||||
|
* io.c (rb_f_syscall): type dispatch should be based on
|
||||||
|
rb_check_string_type(), not FIXNUM_P(), because values may be a
|
||||||
|
bignum. [ruby-talk:72257]
|
||||||
|
|
||||||
Tue May 27 20:33:18 2003 Nobuyoshi Nakada <nobu.nokada@softhome.net>
|
Tue May 27 20:33:18 2003 Nobuyoshi Nakada <nobu.nokada@softhome.net>
|
||||||
|
|
||||||
* eval.c, util.c: removed duplicated includes/defines.
|
* eval.c, util.c: removed duplicated includes/defines.
|
||||||
@ -78,6 +84,21 @@ Tue May 27 20:33:18 2003 Nobuyoshi Nakada <nobu.nokada@softhome.net>
|
|||||||
* ext/socket/socket.c (sock_addrinfo): get rid of SEGV at NULL ptr
|
* ext/socket/socket.c (sock_addrinfo): get rid of SEGV at NULL ptr
|
||||||
String. increase buffer size for 64bit platforms.
|
String. increase buffer size for 64bit platforms.
|
||||||
|
|
||||||
|
Tue May 27 02:34:14 2003 Yukihiro Matsumoto <matz@ruby-lang.org>
|
||||||
|
|
||||||
|
* eval.c (rb_call0): should pass the current klass value to
|
||||||
|
block_invoke, which may be called via "super". [ruby-core:01077]
|
||||||
|
|
||||||
|
* eval.c (block_invoke): now takes 4th argument "klass".
|
||||||
|
|
||||||
|
* eval.c (block_alloc): should propagate BLOCK_PROC to
|
||||||
|
ruby_block.
|
||||||
|
|
||||||
|
Mon May 26 23:51:38 2003 Yukihiro Matsumoto <matz@ruby-lang.org>
|
||||||
|
|
||||||
|
* marshal.c (r_object0): should not use "yield" method, use "call"
|
||||||
|
instead. (ruby-bugs-ja PR#476)
|
||||||
|
|
||||||
Mon May 26 21:39:46 2003 MoonWolf <moonwolf@moonwolf.com>
|
Mon May 26 21:39:46 2003 MoonWolf <moonwolf@moonwolf.com>
|
||||||
|
|
||||||
* lib/mkmf.rb, lib/optparse.rb, lib/tracer.rb: use Method#to_block
|
* lib/mkmf.rb, lib/optparse.rb, lib/tracer.rb: use Method#to_block
|
||||||
|
27
eval.c
27
eval.c
@ -95,7 +95,7 @@ char *strrchr _((const char*,const char));
|
|||||||
|
|
||||||
VALUE rb_cBlock, rb_cProc;
|
VALUE rb_cBlock, rb_cProc;
|
||||||
static VALUE rb_cBinding;
|
static VALUE rb_cBinding;
|
||||||
static VALUE block_invoke _((VALUE,VALUE,VALUE));
|
static VALUE block_invoke _((VALUE,VALUE,VALUE,VALUE));
|
||||||
static VALUE block_new _((void));
|
static VALUE block_new _((void));
|
||||||
static VALUE rb_f_binding _((VALUE));
|
static VALUE rb_f_binding _((VALUE));
|
||||||
static void rb_f_END _((void));
|
static void rb_f_END _((void));
|
||||||
@ -2255,7 +2255,7 @@ call_trace_func(event, node, self, id, klass)
|
|||||||
id?ID2SYM(id):Qnil,
|
id?ID2SYM(id):Qnil,
|
||||||
self?rb_f_binding(self):Qnil,
|
self?rb_f_binding(self):Qnil,
|
||||||
klass),
|
klass),
|
||||||
Qundef);
|
Qundef, 0);
|
||||||
}
|
}
|
||||||
POP_TMPTAG(); /* do not propagate retval */
|
POP_TMPTAG(); /* do not propagate retval */
|
||||||
POP_FRAME();
|
POP_FRAME();
|
||||||
@ -4046,7 +4046,7 @@ rb_yield_0(val, self, klass, pcall, avalue)
|
|||||||
/* FOR does not introduce new scope */
|
/* FOR does not introduce new scope */
|
||||||
ruby_dyna_vars = block->dyna_vars;
|
ruby_dyna_vars = block->dyna_vars;
|
||||||
}
|
}
|
||||||
ruby_class = klass?klass:block->klass;
|
ruby_class = klass ? klass : block->klass;
|
||||||
if (!klass) self = block->self;
|
if (!klass) self = block->self;
|
||||||
node = block->body;
|
node = block->body;
|
||||||
|
|
||||||
@ -4887,7 +4887,7 @@ rb_call0(klass, recv, id, oid, argc, argv, body, nosuper)
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case NODE_BMETHOD:
|
case NODE_BMETHOD:
|
||||||
result = block_invoke(body->nd_cval, rb_ary_new4(argc, argv), recv);
|
result = block_invoke(body->nd_cval, rb_ary_new4(argc, argv), recv, klass);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case NODE_SCOPE:
|
case NODE_SCOPE:
|
||||||
@ -6358,7 +6358,7 @@ call_end_proc(data)
|
|||||||
ruby_frame->self = ruby_frame->prev->self;
|
ruby_frame->self = ruby_frame->prev->self;
|
||||||
ruby_frame->last_func = 0;
|
ruby_frame->last_func = 0;
|
||||||
ruby_frame->last_class = 0;
|
ruby_frame->last_class = 0;
|
||||||
block_invoke(data, rb_ary_new2(0), Qundef);
|
block_invoke(data, rb_ary_new2(0), Qundef, 0);
|
||||||
POP_FRAME();
|
POP_FRAME();
|
||||||
POP_ITER();
|
POP_ITER();
|
||||||
}
|
}
|
||||||
@ -6824,9 +6824,9 @@ block_alloc(klass, proc)
|
|||||||
if ((proc && (ruby_block->flags & BLOCK_PROC)) ||
|
if ((proc && (ruby_block->flags & BLOCK_PROC)) ||
|
||||||
(!proc && !(ruby_block->flags & BLOCK_PROC)))
|
(!proc && !(ruby_block->flags & BLOCK_PROC)))
|
||||||
return ruby_block->block_obj;
|
return ruby_block->block_obj;
|
||||||
|
ruby_block->flags &= ~BLOCK_PROC;
|
||||||
}
|
}
|
||||||
block = Data_Make_Struct(klass, struct BLOCK, blk_mark, blk_free, data);
|
block = Data_Make_Struct(klass, struct BLOCK, blk_mark, blk_free, data);
|
||||||
ruby_block->block_obj = block;
|
|
||||||
*data = *ruby_block;
|
*data = *ruby_block;
|
||||||
|
|
||||||
data->orig_thread = rb_thread_current();
|
data->orig_thread = rb_thread_current();
|
||||||
@ -6850,7 +6850,11 @@ block_alloc(klass, proc)
|
|||||||
}
|
}
|
||||||
scope_dup(data->scope);
|
scope_dup(data->scope);
|
||||||
block_save_safe_level(block);
|
block_save_safe_level(block);
|
||||||
if (proc) data->flags |= BLOCK_PROC;
|
if (proc) {
|
||||||
|
data->flags |= BLOCK_PROC;
|
||||||
|
ruby_block->flags |= BLOCK_PROC;
|
||||||
|
}
|
||||||
|
ruby_block->block_obj = block;
|
||||||
|
|
||||||
return block;
|
return block;
|
||||||
}
|
}
|
||||||
@ -6911,9 +6915,9 @@ block_orphan(data)
|
|||||||
}
|
}
|
||||||
|
|
||||||
static VALUE
|
static VALUE
|
||||||
block_invoke(block, args, self)
|
block_invoke(block, args, self, klass)
|
||||||
VALUE block, args; /* OK */
|
VALUE block, args; /* OK */
|
||||||
VALUE self;
|
VALUE self, klass;
|
||||||
{
|
{
|
||||||
struct BLOCK * volatile old_block;
|
struct BLOCK * volatile old_block;
|
||||||
struct BLOCK _block;
|
struct BLOCK _block;
|
||||||
@ -6941,7 +6945,8 @@ block_invoke(block, args, self)
|
|||||||
/* PUSH BLOCK from data */
|
/* PUSH BLOCK from data */
|
||||||
old_block = ruby_block;
|
old_block = ruby_block;
|
||||||
_block = *data;
|
_block = *data;
|
||||||
_block.frame.self = self;
|
if (self != Qundef) _block.frame.self = self;
|
||||||
|
if (klass) _block.frame.last_class = klass;
|
||||||
ruby_block = &_block;
|
ruby_block = &_block;
|
||||||
|
|
||||||
PUSH_ITER(ITER_CUR);
|
PUSH_ITER(ITER_CUR);
|
||||||
@ -6999,7 +7004,7 @@ static VALUE
|
|||||||
block_call(block, args)
|
block_call(block, args)
|
||||||
VALUE block, args; /* OK */
|
VALUE block, args; /* OK */
|
||||||
{
|
{
|
||||||
return block_invoke(block, args, Qundef);
|
return block_invoke(block, args, Qundef, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
static VALUE bmcall _((VALUE, VALUE));
|
static VALUE bmcall _((VALUE, VALUE));
|
||||||
|
10
io.c
10
io.c
@ -3446,16 +3446,16 @@ rb_f_syscall(argc, argv)
|
|||||||
rb_raise(rb_eArgError, "too few arguments for syscall");
|
rb_raise(rb_eArgError, "too few arguments for syscall");
|
||||||
arg[0] = NUM2LONG(argv[0]); argv++;
|
arg[0] = NUM2LONG(argv[0]); argv++;
|
||||||
while (items--) {
|
while (items--) {
|
||||||
if (FIXNUM_P(*argv)) {
|
VALUE v = rb_check_string_type(*argv);
|
||||||
arg[i] = (unsigned long)NUM2LONG(*argv);
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
VALUE v = *argv;
|
|
||||||
|
|
||||||
|
if (!NIL_P(v)) {
|
||||||
StringValue(v);
|
StringValue(v);
|
||||||
rb_str_modify(v);
|
rb_str_modify(v);
|
||||||
arg[i] = (unsigned long)RSTRING(v)->ptr;
|
arg[i] = (unsigned long)RSTRING(v)->ptr;
|
||||||
}
|
}
|
||||||
|
else {
|
||||||
|
arg[i] = (unsigned long)NUM2LONG(*argv);
|
||||||
|
}
|
||||||
argv++;
|
argv++;
|
||||||
i++;
|
i++;
|
||||||
}
|
}
|
||||||
|
16
lib/debug.rb
16
lib/debug.rb
@ -781,8 +781,8 @@ class << DEBUGGER__
|
|||||||
saved_crit = Thread.critical
|
saved_crit = Thread.critical
|
||||||
Thread.critical = true
|
Thread.critical = true
|
||||||
make_thread_list
|
make_thread_list
|
||||||
for th in @thread_list
|
for th, in @thread_list
|
||||||
context(th[0]).set_trace arg
|
context(th).set_trace arg
|
||||||
end
|
end
|
||||||
Thread.critical = saved_crit
|
Thread.critical = saved_crit
|
||||||
arg
|
arg
|
||||||
@ -796,9 +796,9 @@ class << DEBUGGER__
|
|||||||
saved_crit = Thread.critical
|
saved_crit = Thread.critical
|
||||||
Thread.critical = true
|
Thread.critical = true
|
||||||
make_thread_list
|
make_thread_list
|
||||||
for th in @thread_list
|
for th, in @thread_list
|
||||||
next if th[0] == Thread.current
|
next if th == Thread.current
|
||||||
context(th[0]).set_suspend
|
context(th).set_suspend
|
||||||
end
|
end
|
||||||
Thread.critical = saved_crit
|
Thread.critical = saved_crit
|
||||||
# Schedule other threads to suspend as soon as possible.
|
# Schedule other threads to suspend as soon as possible.
|
||||||
@ -809,9 +809,9 @@ class << DEBUGGER__
|
|||||||
saved_crit = Thread.critical
|
saved_crit = Thread.critical
|
||||||
Thread.critical = true
|
Thread.critical = true
|
||||||
make_thread_list
|
make_thread_list
|
||||||
for th in @thread_list
|
for th, in @thread_list
|
||||||
next if th[0] == Thread.current
|
next if th == Thread.current
|
||||||
context(th[0]).clear_suspend
|
context(th).clear_suspend
|
||||||
end
|
end
|
||||||
waiting.each do |th|
|
waiting.each do |th|
|
||||||
th.run
|
th.run
|
||||||
|
@ -414,7 +414,11 @@ summary feature.
|
|||||||
pat = t if t.respond_to?(:match)
|
pat = t if t.respond_to?(:match)
|
||||||
end
|
end
|
||||||
unless block
|
unless block
|
||||||
|
<<<<<<< optparse.rb
|
||||||
|
block = pat.method(:convert).to_block if pat.respond_to?(:convert)
|
||||||
|
=======
|
||||||
block = pat.method(:convert).to_block if pat.respond_to?(:convert)
|
block = pat.method(:convert).to_block if pat.respond_to?(:convert)
|
||||||
|
>>>>>>> 1.19
|
||||||
end
|
end
|
||||||
@atype[t] = [pat, block]
|
@atype[t] = [pat, block]
|
||||||
end
|
end
|
||||||
@ -949,7 +953,11 @@ Default options, which never appear in option summary.
|
|||||||
# directly specified pattern(any object possible to match)
|
# directly specified pattern(any object possible to match)
|
||||||
if !(String === o) and o.respond_to?(:match)
|
if !(String === o) and o.respond_to?(:match)
|
||||||
pattern = notwice(o, pattern, 'pattern')
|
pattern = notwice(o, pattern, 'pattern')
|
||||||
|
<<<<<<< optparse.rb
|
||||||
|
conv = (pattern.method(:convert).to_block if pattern.respond_to?(:convert))
|
||||||
|
=======
|
||||||
conv = (pattern.method(:convert).to_block if pattern.respond_to?(:convert))
|
conv = (pattern.method(:convert).to_block if pattern.respond_to?(:convert))
|
||||||
|
>>>>>>> 1.19
|
||||||
next
|
next
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -962,7 +970,11 @@ Default options, which never appear in option summary.
|
|||||||
when CompletingHash
|
when CompletingHash
|
||||||
when nil
|
when nil
|
||||||
pattern = CompletingHash.new
|
pattern = CompletingHash.new
|
||||||
|
<<<<<<< optparse.rb
|
||||||
|
conv = (pattern.method(:convert).to_block if pattern.respond_to?(:convert))
|
||||||
|
=======
|
||||||
conv = (pattern.method(:convert).to_block if pattern.respond_to?(:convert))
|
conv = (pattern.method(:convert).to_block if pattern.respond_to?(:convert))
|
||||||
|
>>>>>>> 1.19
|
||||||
else
|
else
|
||||||
raise ArgumentError, "argument pattern given twice"
|
raise ArgumentError, "argument pattern given twice"
|
||||||
end
|
end
|
||||||
|
Loading…
x
Reference in New Issue
Block a user