Skip to content

Commit

Permalink
matz
Browse files Browse the repository at this point in the history
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@1065 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
  • Loading branch information
matz committed Dec 18, 2000
1 parent 652f744 commit 117b7d5
Show file tree
Hide file tree
Showing 12 changed files with 110 additions and 20 deletions.
36 changes: 36 additions & 0 deletions ChangeLog
Original file line number Diff line number Diff line change
@@ -1,3 +1,28 @@
Mon Dec 18 18:10:30 2000 Yukihiro Matsumoto <[email protected]>

* time.c (time_plus): usec might underflow (ruby-bugs-ja:#PR33).

Mon Dec 18 08:11:20 2000 Yukihiro Matsumoto <[email protected]>

* hash.c (rb_hash_set_default): should call rb_hash_modify().

Sat Dec 16 02:58:26 2000 Minero Aoki <[email protected]>

* eval.c (rb_eval): should clear ruby_errinfo on retry.

* eval.c (rb_rescue2): ditto.

Thu Dec 14 13:06:18 2000 Nobuyoshi Nakada <[email protected]>

* 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 <[email protected]>

* lib/cgi.rb: support -T1 on ruby 1.6.2
Expand All @@ -6,6 +31,17 @@ Thu Dec 14 09:20:26 2000 Wakou Aoyama <[email protected]>

* lib/net/telnet.rb: ditto.

Wed Dec 13 23:27:06 2000 Yukihiro Matsumoto <[email protected]>

* 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 <[email protected]>

* ruby.c (proc_options): accept "--^M" for DOS line endings.
Expand Down
1 change: 1 addition & 0 deletions class.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
57 changes: 46 additions & 11 deletions eval.c
Original file line number Diff line number Diff line change
Expand Up @@ -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(?!)";
Expand Down Expand Up @@ -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));
Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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) {
Expand Down Expand Up @@ -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) {
Expand Down Expand Up @@ -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;
}
}
Expand Down
1 change: 1 addition & 0 deletions hash.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down
1 change: 1 addition & 0 deletions instruby.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
load "./rbconfig.rb"
include Config

File.umask(0)
destdir = ARGV[0] || ''

$:.unshift CONFIG["srcdir"]+"/lib"
Expand Down
3 changes: 2 additions & 1 deletion intern.h
Original file line number Diff line number Diff line change
Expand Up @@ -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));
Expand Down
4 changes: 2 additions & 2 deletions lib/README
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions lib/date.rb
Original file line number Diff line number Diff line change
@@ -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

Expand Down
7 changes: 7 additions & 0 deletions missing/vsnprintf.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
8 changes: 6 additions & 2 deletions parse.y
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 4 additions & 0 deletions time.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
4 changes: 2 additions & 2 deletions version.h
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit 117b7d5

Please sign in to comment.