mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
* eval.c (mark_frame_adj): need to adjust argv pointer if using
system's alloca. [ruby-core:01503] * io.c (rb_f_gets): should call next_argv() before type check current_file. [ruby-list:38336] * eval.c (proc_invoke): should retrieve retval when pcall is true. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@4509 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
4198feb844
commit
c492b9b085
5 changed files with 59 additions and 27 deletions
14
ChangeLog
14
ChangeLog
|
@ -101,6 +101,11 @@ Thu Sep 4 12:54:50 2003 why the lucky stiff <ruby-cvs@whytheluckystiff.net>
|
|||
* ext/syck/token.c: headerless documents with root-level spacing now
|
||||
honored.
|
||||
|
||||
Thu Sep 4 00:06:14 2003 Yukihiro Matsumoto <matz@ruby-lang.org>
|
||||
|
||||
* eval.c (mark_frame_adj): need to adjust argv pointer if using
|
||||
system's alloca. [ruby-core:01503]
|
||||
|
||||
Wed Sep 3 21:33:20 2003 NAKAMURA, Hiroshi <nahi@ruby-lang.org>
|
||||
|
||||
* test: add test directory. Test::Unit aware testcases and needed
|
||||
|
@ -112,11 +117,20 @@ Wed Sep 3 21:33:20 2003 NAKAMURA, Hiroshi <nahi@ruby-lang.org>
|
|||
|
||||
* test/csv/*: add testcase for lib/csv.rb.
|
||||
|
||||
Wed Sep 3 01:37:09 2003 Yukihiro Matsumoto <matz@ruby-lang.org>
|
||||
|
||||
* io.c (rb_f_gets): should call next_argv() before type check
|
||||
current_file. [ruby-list:38336]
|
||||
|
||||
Tue Sep 2 20:37:15 2003 GOTOU Yuuzou <gotoyuzo@notwork.org>
|
||||
|
||||
* ext/openssl/lib/net/protocols.rb (SSLIO#ssl_connect): warning
|
||||
for skipping server verification.
|
||||
|
||||
Tue Sep 2 23:36:57 2003 Yukihiro Matsumoto <matz@ruby-lang.org>
|
||||
|
||||
* eval.c (proc_invoke): should retrieve retval when pcall is true.
|
||||
|
||||
Tue Sep 2 14:09:20 2003 Yukihiro Matsumoto <matz@ruby-lang.org>
|
||||
|
||||
* ext/socket/extconf.rb: check s6_addr8 in in6_addr (Tru64 UNIX).
|
||||
|
|
25
array.c
25
array.c
|
@ -1095,17 +1095,16 @@ rb_ary_reverse(ary)
|
|||
VALUE tmp;
|
||||
|
||||
rb_ary_modify(ary);
|
||||
if (RARRAY(ary)->len <= 1) return ary;
|
||||
if (RARRAY(ary)->len > 1) {
|
||||
p1 = RARRAY(ary)->ptr;
|
||||
p2 = p1 + RARRAY(ary)->len - 1; /* points last item */
|
||||
|
||||
p1 = RARRAY(ary)->ptr;
|
||||
p2 = p1 + RARRAY(ary)->len - 1; /* points last item */
|
||||
|
||||
while (p1 < p2) {
|
||||
tmp = *p1;
|
||||
*p1++ = *p2;
|
||||
*p2-- = tmp;
|
||||
while (p1 < p2) {
|
||||
tmp = *p1;
|
||||
*p1++ = *p2;
|
||||
*p2-- = tmp;
|
||||
}
|
||||
}
|
||||
|
||||
return ary;
|
||||
}
|
||||
|
||||
|
@ -1173,10 +1172,10 @@ rb_ary_sort_bang(ary)
|
|||
VALUE ary;
|
||||
{
|
||||
rb_ary_modify(ary);
|
||||
if (RARRAY(ary)->len <= 1) return ary;
|
||||
|
||||
FL_SET(ary, ARY_TMPLOCK); /* prohibit modification during sort */
|
||||
rb_ensure(sort_internal, ary, sort_unlock, ary);
|
||||
if (RARRAY(ary)->len > 1) {
|
||||
FL_SET(ary, ARY_TMPLOCK); /* prohibit modification during sort */
|
||||
rb_ensure(sort_internal, ary, sort_unlock, ary);
|
||||
}
|
||||
return ary;
|
||||
}
|
||||
|
||||
|
|
27
eval.c
27
eval.c
|
@ -7023,7 +7023,7 @@ proc_invoke(proc, args, self, klass)
|
|||
proc_set_safe_level(proc);
|
||||
result = rb_yield_0(args, self, self!=Qundef?CLASS_OF(self):0, pcall, Qtrue);
|
||||
}
|
||||
else if (TAG_DST()) {
|
||||
else if (pcall || TAG_DST()) {
|
||||
result = prot_tag->retval;
|
||||
}
|
||||
POP_TAG();
|
||||
|
@ -8043,6 +8043,25 @@ timeofday()
|
|||
|
||||
#define STACK(addr) (th->stk_pos<(VALUE*)(addr) && (VALUE*)(addr)<th->stk_pos+th->stk_len)
|
||||
#define ADJ(addr) (void*)(STACK(addr)?(((VALUE*)(addr)-th->stk_pos)+th->stk_ptr):(VALUE*)(addr))
|
||||
#ifdef C_ALLOCA
|
||||
# define MARK_FRAME_ADJ(f) rb_gc_mark_frame(f)
|
||||
#else
|
||||
# define MARK_FRAME_ADJ(f) mark_frame_adj(f, th)
|
||||
static void
|
||||
mark_frame_adj(frame, th)
|
||||
struct FRAME *frame;
|
||||
rb_thread_t th;
|
||||
{
|
||||
if (frame->flags & FRAME_MALLOC) {
|
||||
rb_gc_mark_locations(frame->argv, frame->argv+frame->argc);
|
||||
}
|
||||
else {
|
||||
VALUE *start = ADJ(frame->argv);
|
||||
rb_gc_mark_locations(start, start+frame->argc);
|
||||
}
|
||||
rb_gc_mark((VALUE)frame->node);
|
||||
}
|
||||
#endif
|
||||
|
||||
static void
|
||||
thread_mark(th)
|
||||
|
@ -8084,13 +8103,13 @@ thread_mark(th)
|
|||
frame = th->frame;
|
||||
while (frame && frame != top_frame) {
|
||||
frame = ADJ(frame);
|
||||
rb_gc_mark_frame(frame);
|
||||
MARK_FRAME_ADJ(frame);
|
||||
if (frame->tmp) {
|
||||
struct FRAME *tmp = frame->tmp;
|
||||
|
||||
while (tmp && tmp != top_frame) {
|
||||
tmp = ADJ(tmp);
|
||||
rb_gc_mark_frame(tmp);
|
||||
MARK_FRAME_ADJ(tmp);
|
||||
tmp = tmp->prev;
|
||||
}
|
||||
}
|
||||
|
@ -8099,7 +8118,7 @@ thread_mark(th)
|
|||
block = th->block;
|
||||
while (block) {
|
||||
block = ADJ(block);
|
||||
rb_gc_mark_frame(&block->frame);
|
||||
MARK_FRAME_ADJ(&block->frame);
|
||||
block = block->prev;
|
||||
}
|
||||
}
|
||||
|
|
2
io.c
2
io.c
|
@ -3115,8 +3115,8 @@ rb_f_gets(argc, argv)
|
|||
{
|
||||
VALUE line;
|
||||
|
||||
if (!next_argv()) return Qnil;
|
||||
if (TYPE(current_file) != T_FILE) {
|
||||
if (!next_argv()) return Qnil;
|
||||
line = rb_funcall3(current_file, rb_intern("gets"), argc, argv);
|
||||
}
|
||||
else {
|
||||
|
|
18
string.c
18
string.c
|
@ -1807,16 +1807,16 @@ rb_str_reverse_bang(str)
|
|||
char *s, *e;
|
||||
char c;
|
||||
|
||||
if (RSTRING(str)->len <= 1) return Qnil;
|
||||
rb_str_modify(str);
|
||||
s = RSTRING(str)->ptr;
|
||||
e = s + RSTRING(str)->len - 1;
|
||||
while (s < e) {
|
||||
c = *s;
|
||||
*s++ = *e;
|
||||
*e-- = c;
|
||||
if (RSTRING(str)->len > 1) {
|
||||
rb_str_modify(str);
|
||||
s = RSTRING(str)->ptr;
|
||||
e = s + RSTRING(str)->len - 1;
|
||||
while (s < e) {
|
||||
c = *s;
|
||||
*s++ = *e;
|
||||
*e-- = c;
|
||||
}
|
||||
}
|
||||
|
||||
return str;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue