Skip to content

Commit f3d25fd

Browse files
author
matz
committed
* gc.c (id2ref): recycle check should be done by klass == 0.
[ruby-core:01408] * eval.c (Init_Thread): Continuation#[] added. [ruby-talk:79028] * parse.y (mlhs_node): should allow "::Foo" (colon3) as lhs. * parse.y (lhs): ditto. * parse.y (yylex): should return tCOLON3 right after kCLASS. [ruby-talk:78918] * error.c (exc_initialize): was converting argument to string too eagerly. Only check was needed. [ruby-talk:78958] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@4390 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
1 parent 206efa1 commit f3d25fd

File tree

6 files changed

+46
-7
lines changed

6 files changed

+46
-7
lines changed

ChangeLog

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
Fri Aug 15 02:08:53 2003 Yukihiro Matsumoto <matz@ruby-lang.org>
2+
3+
* gc.c (id2ref): recycle check should be done by klass == 0.
4+
[ruby-core:01408]
5+
16
Fri Aug 15 00:38:00 2003 Shigeo Kobayashi <shigek@ruby-lang.org>
27

38
* ext/bigdecimal/bigdecimal.c: Bug in div method fixed.
@@ -6,6 +11,10 @@ Fri Aug 15 00:38:00 2003 Shigeo Kobayashi <shigek@ruby-lang.org>
611

712
* ext/bigdecimal/sample/pi.rb: Changed so as to use math.rb.
813

14+
Thu Aug 14 21:19:14 2003 Yukihiro Matsumoto <matz@ruby-lang.org>
15+
16+
* eval.c (Init_Thread): Continuation#[] added. [ruby-talk:79028]
17+
918
Thu Aug 14 20:03:34 2003 Masaki Suketa <masaki.suketa@nifty.ne.jp>
1019

1120
* ext/win32ole/win32ole.c (OLE_FREE): should not call
@@ -21,6 +30,18 @@ Thu Aug 14 11:27:37 2003 NAKAMURA Usaku <usa@ruby-lang.org>
2130
* gc.c (rb_data_object_alloc): check type of 1st argument.
2231
[ruby-dev:21192]
2332

33+
Thu Aug 14 00:21:14 2003 Yukihiro Matsumoto <matz@ruby-lang.org>
34+
35+
* parse.y (mlhs_node): should allow "::Foo" (colon3) as lhs.
36+
37+
* parse.y (lhs): ditto.
38+
39+
* parse.y (yylex): should return tCOLON3 right after kCLASS.
40+
[ruby-talk:78918]
41+
42+
* error.c (exc_initialize): was converting argument to string too
43+
eagerly. Only check was needed. [ruby-talk:78958]
44+
2445
Wed Aug 13 23:31:00 2003 Shigeo Kobayashi <shigek@ruby-lang.org>
2546

2647
* ext/bigdecimal/bigdecimal.c .h .html: Ambiguity of

error.c

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -318,12 +318,13 @@ exc_initialize(argc, argv, exc)
318318
VALUE *argv;
319319
VALUE exc;
320320
{
321-
VALUE mesg;
321+
VALUE arg;
322322

323-
if (rb_scan_args(argc, argv, "01", &mesg) == 1) {
323+
if (rb_scan_args(argc, argv, "01", &arg) == 1) {
324+
VALUE mesg = arg;
324325
StringValue(mesg); /* ensure mesg can be converted to String */
325326
}
326-
rb_iv_set(exc, "mesg", mesg);
327+
rb_iv_set(exc, "mesg", arg);
327328
rb_iv_set(exc, "bt", Qnil);
328329

329330
return exc;

eval.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10114,6 +10114,7 @@ Init_Thread()
1011410114
rb_undef_alloc_func(rb_cCont);
1011510115
rb_undef_method(CLASS_OF(rb_cCont), "new");
1011610116
rb_define_method(rb_cCont, "call", rb_cont_call, -1);
10117+
rb_define_method(rb_cCont, "[]", rb_cont_call, -1);
1011710118
rb_define_global_function("callcc", rb_callcc, 0);
1011810119

1011910120
cThGroup = rb_define_class("ThreadGroup", rb_cObject);

gc.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1639,7 +1639,7 @@ id2ref(obj, id)
16391639
if (!is_pointer_to_heap((void *)ptr)) {
16401640
rb_raise(rb_eRangeError, "0x%lx is not id value", p0);
16411641
}
1642-
if (BUILTIN_TYPE(ptr) == 0) {
1642+
if (RBASIC(ptr)->klass == 0) {
16431643
rb_raise(rb_eRangeError, "0x%lx is recycled object", p0);
16441644
}
16451645
return (VALUE)ptr;

lib/xmlrpc/utils.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ class Interface < BasicInterface
113113
def initialize(prefix, &p)
114114
raise "No interface specified" if p.nil?
115115
super(prefix)
116-
instance_eval &p
116+
instance_eval(&p)
117117
end
118118

119119
def get_methods(obj, delim=".")

parse.y

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -809,6 +809,12 @@ mlhs_node : variable
809809
yyerror("dynamic constant assignment");
810810
$$ = NEW_CDECL(0, 0, NEW_COLON2($1, $3));
811811
}
812+
| tCOLON3 tCONSTANT
813+
{
814+
if (in_def || in_single)
815+
yyerror("dynamic constant assignment");
816+
$$ = NEW_CDECL(0, 0, NEW_COLON3($2));
817+
}
812818
| backref
813819
{
814820
rb_backref_error($1);
@@ -842,6 +848,12 @@ lhs : variable
842848
yyerror("dynamic constant assignment");
843849
$$ = NEW_CDECL(0, 0, NEW_COLON2($1, $3));
844850
}
851+
| tCOLON3 tCONSTANT
852+
{
853+
if (in_def || in_single)
854+
yyerror("dynamic constant assignment");
855+
$$ = NEW_CDECL(0, 0, NEW_COLON3($2));
856+
}
845857
| backref
846858
{
847859
rb_backref_error($1);
@@ -1026,6 +1038,10 @@ arg : lhs '=' arg
10261038
{
10271039
yyerror("constant re-assignment");
10281040
}
1041+
| tCOLON3 tCONSTANT tOP_ASGN arg
1042+
{
1043+
yyerror("constant re-assignment");
1044+
}
10291045
| backref tOP_ASGN arg
10301046
{
10311047
rb_backref_error($1);
@@ -1431,7 +1447,7 @@ primary : literal
14311447
{
14321448
$$ = NEW_COLON2($1, $3);
14331449
}
1434-
| tCOLON3 cname
1450+
| tCOLON3 tCONSTANT
14351451
{
14361452
$$ = NEW_COLON3($2);
14371453
}
@@ -3928,7 +3944,7 @@ yylex()
39283944
c = nextc();
39293945
if (c == ':') {
39303946
if (lex_state == EXPR_BEG || lex_state == EXPR_MID ||
3931-
(IS_ARG() && space_seen)) {
3947+
lex_state == EXPR_CLASS || (IS_ARG() && space_seen)) {
39323948
lex_state = EXPR_BEG;
39333949
return tCOLON3;
39343950
}

0 commit comments

Comments
 (0)