e$B=uED$G$9!#e(B
e$B<!$N%9%/%j%W%H$,!"e(Bruby 1.9.0 (2006-09-03)e$B$Ge(B
falsee$B$H=PNO$5$l$^$9!#e(B
class Foo
def method_missing(id, *arg)
p id # => false
end
end
foo = Foo.new
foo.visible = true
e$B<B9T7k2Le(B
W: ~/work>ruby19 -v mm.rb
ruby 1.9.0 (2006-09-03) [i386-cygwin]
false
W: ~/work>ruby -v mm.rb
ruby 1.8.5 (2006-09-01) [i386-cygwin]
:visible=
e$B=uEDe(B e$B2m5*e(B
e$B$J$+$@$G$9!#e(B
At Sun, 3 Sep 2006 09:55:59 +0900,
Masaki S. wrote in [ruby-dev:29420]:
e$B<!$N%9%/%j%W%H$,!"e(Bruby 1.9.0 (2006-09-03)e$B$Ge(B falsee$B$H=PNO$5$l$^$9!#e(B
class Foo
def method_missing(id, *arg)
p id # => false
end
end
foo = Foo.new
foo.visible = true
e$B$?$^$?$^e(Bfalse(== 0)e$B$K$J$C$?$@$1$G!"<B:]$K$OITDjCM$G$9$M!#e(B
Index: gc.c
RCS file: /cvs/ruby/src/ruby/gc.c,v
retrieving revision 1.248
diff -p -U 2 -r1.248 gc.c
— gc.c 2 Sep 2006 15:05:27 -0000 1.248
+++ gc.c 3 Sep 2006 01:12:58 -0000
@@ -1382,5 +1382,5 @@ garbage_collect(void)
#endif
rb_gc_mark_threads();
-
rb_gc_mark_symbols(0);
/* mark protected global variables */
Index: intern.h
===================================================================
RCS file: /cvs/ruby/src/ruby/intern.h,v
retrieving revision 1.199
diff -p -U 2 -r1.199 intern.h
— intern.h 31 Aug 2006 08:24:36 -0000 1.199
+++ intern.h 3 Sep 2006 01:12:33 -0000
@@ -259,4 +259,5 @@ int ruby_cleanup(int);
int ruby_exec(void);
void rb_gc_mark_threads(void);
+void rb_gc_mark_symbols(int);
void rb_thread_start_timer(void);
void rb_thread_stop_timer(void);
Index: parse.y
===================================================================
RCS file: /cvs/ruby/src/ruby/parse.y,v
retrieving revision 1.456
diff -p -U 2 -r1.456 parse.y
— parse.y 2 Sep 2006 15:05:27 -0000 1.456
+++ parse.y 3 Sep 2006 05:10:38 -0000
@@ -6030,5 +6030,4 @@ parser_yylex(struct parser_params *parse
}
if (c == ‘>’) {
@@ -8379,4 +8378,13 @@ rb_symname_p(const char *name)
}
+static void
+register_symid(VALUE sym, ID id)
+{
- RBASIC(sym)->klass = rb_cSymbol;
- OBJ_FREEZE(sym);
- st_add_direct(global_symbols.sym_id, (st_data_t)sym, id);
- st_add_direct(global_symbols.id_sym, id, (st_data_t)sym);
+}
-
ID
rb_intern2(const char *name, long len)
@@ -8451,8 +8459,5 @@ rb_intern2(const char *name, long len)
id |= ++global_symbols.last_id << ID_SCOPE_SHIFT;
id_register:
- RBASIC(sym)->klass = rb_cSymbol;
- OBJ_FREEZE(sym);
- st_add_direct(global_symbols.sym_id, (st_data_t)sym, id);
- st_add_direct(global_symbols.id_sym, id, (st_data_t)sym);
- register_symid(sym, id);
return id;
}
@@ -8467,12 +8472,25 @@ VALUE
rb_id2sym(ID id)
{
@@ -8490,6 +8508,5 @@ const char *
rb_id2name(ID id)
{
- const char *name;
- st_data_t data;
- sym = rb_id2sym(id);
- if (!NIL_P(sym)) {
- return RSTRING_PTR(sym);
}
return 0;