1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

* ruby.c (set_arg0): wrong predicate when new $0 value is bigger

than original space.

* gc.c (id2ref): should use NUM2ULONG()

* object.c (rb_mod_const_get): check whether name is a class
  variable name.

* object.c (rb_mod_const_set): ditto.

* object.c (rb_mod_const_defined): ditto.

* marshal.c (w_float): precision changed to "%.16g"

* eval.c (rb_call0): wrong retry behavior.

* numeric.c (fix_aref): a bug on long>int architecture.

* eval.c (rb_eval_string_wrap): should restore ruby_wrapper.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_6@1333 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
matz 2001-04-24 06:44:13 +00:00
parent 81e661b298
commit be712bae3a
8 changed files with 65 additions and 14 deletions

View file

@ -1,3 +1,19 @@
Tue Apr 24 15:35:32 2001 Yukihiro Matsumoto <matz@ruby-lang.org>
* ruby.c (set_arg0): wrong predicate when new $0 value is bigger
than original space.
Mon Apr 23 14:43:59 2001 Yukihiro Matsumoto <matz@ruby-lang.org>
* gc.c (id2ref): should use NUM2ULONG()
* object.c (rb_mod_const_get): check whether name is a class
variable name.
* object.c (rb_mod_const_set): ditto.
* object.c (rb_mod_const_defined): ditto.
Sun Apr 22 17:44:37 2001 WATANABE Hirofumi <eban@ruby-lang.org>
* configure.in: add -mieee to CFLAGS on Linux/Alpha
@ -5,6 +21,22 @@ Sun Apr 22 17:44:37 2001 WATANABE Hirofumi <eban@ruby-lang.org>
* configure.in: remove -ansi on OSF/1.
Sat Apr 21 22:33:26 2001 Yukihiro Matsumoto <matz@ruby-lang.org>
* marshal.c (w_float): precision changed to "%.16g"
Sat Apr 21 22:07:58 2001 Guy Decoux <decoux@moulon.inra.fr>
* eval.c (rb_call0): wrong retry behavior.
Fri Apr 20 19:12:20 2001 Yukihiro Matsumoto <matz@ruby-lang.org>
* numeric.c (fix_aref): a bug on long>int architecture.
Fri Apr 20 14:57:15 2001 K.Kosako <kosako@sofnec.co.jp>
* eval.c (rb_eval_string_wrap): should restore ruby_wrapper.
Wed Apr 18 04:37:51 2001 Wakou Aoyama <wakou@fsinet.or.jp>
* lib/cgi.rb: CGI::Cookie: no use PATH_INFO.

4
eval.c
View file

@ -1257,6 +1257,7 @@ rb_eval_string_wrap(str, state)
{
int status;
VALUE self = ruby_top_self;
VALUE wrapper = ruby_wrapper;
VALUE val;
PUSH_CLASS();
@ -1268,6 +1269,7 @@ rb_eval_string_wrap(str, state)
ruby_top_self = self;
POP_CLASS();
ruby_wrapper = wrapper;
if (state) {
*state = status;
}
@ -4442,7 +4444,7 @@ rb_call0(klass, recv, id, argc, argv, body, nosuper)
case TAG_RETRY:
if (rb_block_given_p()) {
break;
JUMP_TAG(state);
}
/* fall through */
default:

2
gc.c
View file

@ -1289,7 +1289,7 @@ id2ref(obj, id)
unsigned long ptr, p0;
rb_secure(4);
p0 = ptr = NUM2UINT(id);
p0 = ptr = NUM2ULONG(id);
if (ptr == Qtrue) return Qtrue;
if (ptr == Qfalse) return Qfalse;
if (ptr == Qnil) return Qnil;

View file

@ -187,7 +187,7 @@ w_float(d, arg)
{
char buf[100];
sprintf(buf, "%.12g", d);
sprintf(buf, "%.16g", d);
w_bytes(buf, strlen(buf), arg);
}

View file

@ -1295,12 +1295,14 @@ static VALUE
fix_aref(fix, idx)
VALUE fix, idx;
{
unsigned long val = FIX2LONG(fix);
long val = FIX2LONG(fix);
int i = NUM2INT(idx);
if (i < 0 || sizeof(VALUE)*CHAR_BIT-1 < i)
if (i < 0 || sizeof(VALUE)*CHAR_BIT-1 < i) {
if (val < 0) return INT2FIX(1);
return INT2FIX(0);
if (val & (1<<i))
}
if (val & (1L<<i))
return INT2FIX(1);
return INT2FIX(0);
}

View file

@ -752,14 +752,24 @@ static VALUE
rb_mod_const_get(mod, name)
VALUE mod, name;
{
return rb_const_get(mod, rb_to_id(name));
ID id = rb_to_id(name);
if (!rb_is_const_id(id)) {
rb_raise(rb_eNameError, "wrong constant name %s", name);
}
return rb_const_get(mod, id);
}
static VALUE
rb_mod_const_set(mod, name, value)
VALUE mod, name, value;
{
rb_const_set(mod, rb_to_id(name), value);
ID id = rb_to_id(name);
if (!rb_is_const_id(id)) {
rb_raise(rb_eNameError, "wrong constant name %s", name);
}
rb_const_set(mod, id, value);
return value;
}
@ -767,7 +777,12 @@ static VALUE
rb_mod_const_defined(mod, name)
VALUE mod, name;
{
return rb_const_defined_at(mod, rb_to_id(name));
ID id = rb_to_id(name);
if (!rb_is_const_id(id)) {
rb_raise(rb_eNameError, "wrong constant name %s", name);
}
return rb_const_defined_at(mod, id);
}
static VALUE

6
ruby.c
View file

@ -877,9 +877,9 @@ set_arg0(val, id)
#endif
s = rb_str2cstr(val, &i);
#ifndef __hpux
if (i > len) {
memcpy(origargv[0], s, len);
origargv[0][len] = '\0';
if (i < len) {
memcpy(origargv[0], s, i);
origargv[0][i] = '\0';
}
else {
memcpy(origargv[0], s, i);

View file

@ -1,4 +1,4 @@
#define RUBY_VERSION "1.6.4"
#define RUBY_RELEASE_DATE "2001-04-19"
#define RUBY_RELEASE_DATE "2001-04-24"
#define RUBY_VERSION_CODE 164
#define RUBY_RELEASE_CODE 20010419
#define RUBY_RELEASE_CODE 20010424