1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@1065 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
matz 2000-12-18 09:46:21 +00:00
parent 652f744cba
commit 117b7d5c47
12 changed files with 110 additions and 20 deletions

View file

@ -1,3 +1,28 @@
Mon Dec 18 18:10:30 2000 Yukihiro Matsumoto <matz@ruby-lang.org>
* time.c (time_plus): usec might underflow (ruby-bugs-ja:#PR33).
Mon Dec 18 08:11:20 2000 Yukihiro Matsumoto <matz@ruby-lang.org>
* hash.c (rb_hash_set_default): should call rb_hash_modify().
Sat Dec 16 02:58:26 2000 Minero Aoki <aamine@dp.u-netsurf.ne.jp>
* eval.c (rb_eval): should clear ruby_errinfo on retry.
* eval.c (rb_rescue2): ditto.
Thu Dec 14 13:06:18 2000 Nobuyoshi Nakada <nobu.nakada@nifty.ne.jp>
* class.c (rb_include_module): prohibit fronzen class/module.
* eval.c (rb_frozen_class_p): make external.
* intern.h (rb_frozen_class_p): prototyped.
* intern.h (rb_undef): prototyped not but rb_undef_method()
which is also in ruby.h.
Thu Dec 14 09:20:26 2000 Wakou Aoyama <wakou@fsinet.or.jp>
* lib/cgi.rb: support -T1 on ruby 1.6.2
@ -6,6 +31,17 @@ Thu Dec 14 09:20:26 2000 Wakou Aoyama <wakou@fsinet.or.jp>
* lib/net/telnet.rb: ditto.
Wed Dec 13 23:27:06 2000 Yukihiro Matsumoto <matz@ruby-lang.org>
* eval.c (rb_eval): handles case statement without expr, which
looks for any TRUE (non nil, non false) when expression.
* parse.y (primary): case expression should not be compstmt, but
mere expr.
* parse.y (primary): case without following expression is now
separated rule.
Wed Dec 13 12:41:27 2000 WATANABE Hirofumi <eban@ruby-lang.org>
* ruby.c (proc_options): accept "--^M" for DOS line endings.

View file

@ -241,6 +241,7 @@ rb_include_module(klass, module)
return;
}
}
rb_frozen_class_p(klass);
RCLASS(klass)->super =
include_class_new(module, RCLASS(klass)->super);
klass = RCLASS(klass)->super;

57
eval.c
View file

@ -1459,8 +1459,8 @@ rb_mod_s_constants()
return ary;
}
static void
frozen_class_p(klass)
void
rb_frozen_class_p(klass)
VALUE klass;
{
char *desc = "something(?!)";
@ -1495,7 +1495,7 @@ rb_undef(klass, id)
if (rb_safe_level() >= 4 && !OBJ_TAINTED(klass)) {
rb_raise(rb_eSecurityError, "Insecure: can't undef");
}
frozen_class_p(klass);
rb_frozen_class_p(klass);
if (id == __id__ || id == __send__) {
rb_warn("undefining `%s' may cause serious problem",
rb_id2name(id));
@ -1541,7 +1541,7 @@ rb_alias(klass, name, def)
VALUE origin;
NODE *orig, *body;
frozen_class_p(klass);
rb_frozen_class_p(klass);
if (name == def) return;
if (klass == rb_cObject) {
rb_secure(4);
@ -2054,16 +2054,49 @@ rb_eval(self, n)
}
goto again;
case NODE_WHEN:
while (node) {
NODE *tag;
if (nd_type(node) != NODE_WHEN) goto again;
tag = node->nd_head;
while (tag) {
if (trace_func) {
call_trace_func("line", tag->nd_file, nd_line(tag), self,
ruby_frame->last_func,
ruby_frame->last_class);
}
ruby_sourcefile = tag->nd_file;
ruby_sourceline = nd_line(tag);
if (nd_type(tag->nd_head) == NODE_WHEN) {
VALUE v = rb_eval(self, tag->nd_head->nd_head);
int i;
if (TYPE(v) != T_ARRAY) v = rb_Array(v);
for (i=0; i<RARRAY(v)->len; i++) {
if (RTEST(RARRAY(v)->ptr[i])) {
node = node->nd_body;
goto again;
}
}
tag = tag->nd_next;
continue;
}
if (RTEST(rb_eval(self, tag->nd_head))) {
node = node->nd_body;
goto again;
}
tag = tag->nd_next;
}
node = node->nd_next;
}
RETURN(Qnil);
case NODE_CASE:
{
VALUE val;
if (node->nd_head) {
val = rb_eval(self, node->nd_head);
}
else {
val = Qtrue;
}
val = rb_eval(self, node->nd_head);
node = node->nd_body;
while (node) {
NODE *tag;
@ -2287,6 +2320,7 @@ rb_eval(self, n)
POP_TAG();
if (state == TAG_RETRY) {
state = 0;
ruby_errinfo = Qnil;
goto retry_entry;
}
if (state != TAG_RAISE) {
@ -2858,7 +2892,7 @@ rb_eval(self, n)
rb_warn("redefining `%s' may cause serious problem",
rb_id2name(node->nd_mid));
}
frozen_class_p(ruby_class);
rb_frozen_class_p(ruby_class);
body = search_method(ruby_class, node->nd_mid, &origin);
if (body){
if (RTEST(ruby_verbose) && ruby_class == origin && body->nd_cnt == 0) {
@ -3821,6 +3855,7 @@ rb_rescue2(b_proc, data1, r_proc, data2, va_alist)
POP_TAG();
if (state == TAG_RETRY) {
state = 0;
ruby_errinfo = Qnil;
goto retry_entry;
}
}

1
hash.c
View file

@ -333,6 +333,7 @@ static VALUE
rb_hash_set_default(hash, ifnone)
VALUE hash, ifnone;
{
rb_hash_modify(hash);
RHASH(hash)->ifnone = ifnone;
return hash;
}

View file

@ -3,6 +3,7 @@
load "./rbconfig.rb"
include Config
File.umask(0)
destdir = ARGV[0] || ''
$:.unshift CONFIG["srcdir"]+"/lib"

View file

@ -90,7 +90,8 @@ VALUE rb_class_protected_instance_methods _((int, VALUE*, VALUE));
VALUE rb_class_private_instance_methods _((int, VALUE*, VALUE));
VALUE rb_obj_singleton_methods _((VALUE));
void rb_define_method_id _((VALUE, ID, VALUE (*)(), int));
void rb_undef_method _((VALUE, const char*));
void rb_frozen_class_p _((VALUE));
void rb_undef _((VALUE, ID));
void rb_define_protected_method _((VALUE, const char*, VALUE (*)(), int));
void rb_define_private_method _((VALUE, const char*, VALUE (*)(), int));
void rb_define_singleton_method _((VALUE,const char*,VALUE(*)(),int));

View file

@ -4,8 +4,8 @@ README this file
base64.rb encode/decode base64 (obsolete)
cgi-lib.rb decode CGI data
complex.rb complex number suppor
date.rb date object (compatible)
date2.rb yet another (better) date object
date.rb date object
date2.rb date object (compatible)
debug.rb ruby debugger
delegate.rb delegate messages to other object
e2mmap.rb exception utilities

View file

@ -1,5 +1,5 @@
# date2.rb: Written by Tadayoshi Funaba 1998-2000
# $Id: date2.rb,v 1.22 2000-07-16 10:23:40+09 tadf Exp $
# date.rb: Written by Tadayoshi Funaba 1998-2000
# $Id: date.rb,v 1.22 2000-07-16 10:23:40+09 tadf Exp $
class Date

View file

@ -34,6 +34,13 @@
* SUCH DAMAGE.
*/
/*
* IMPORTANT NOTE:
* --------------
* From ftp://ftp.cs.berkeley.edu/pub/4bsd/README.Impt.License.Change
* paragraph 3 above is now null and void.
*/
/* SNPRINTF.C
* fjc 7-31-97 Modified by Mib Software to be a standalone snprintf.c module.
* http://www.mibsoftware.com

View file

@ -1203,14 +1203,18 @@ primary : literal
$$ = NEW_UNTIL(cond($3), $6, 1);
fixpos($$, $3);
}
| kCASE compstmt
| kCASE expr opt_terms
case_body
kEND
{
value_expr($2);
$$ = NEW_CASE($2, $3);
$$ = NEW_CASE($2, $4);
fixpos($$, $2);
}
| kCASE opt_terms case_body kEND
{
$$ = $3;
}
| kFOR block_var kIN {COND_PUSH;} expr do {COND_POP;}
compstmt
kEND

4
time.c
View file

@ -659,6 +659,10 @@ time_plus(time1, time2)
sec++;
usec -= 1000000;
}
if (usec < 0) { /* usec underflow */
sec--;
usec += 1000000;
}
time2 = rb_time_new(sec, usec);
if (tobj->gmt) {
GetTimeval(time2, tobj);

View file

@ -1,4 +1,4 @@
#define RUBY_VERSION "1.6.2"
#define RUBY_RELEASE_DATE "2000-12-13"
#define RUBY_RELEASE_DATE "2000-12-18"
#define RUBY_VERSION_CODE 162
#define RUBY_RELEASE_CODE 20001213
#define RUBY_RELEASE_CODE 20001218