[Bug #2965] method `===' called on hidden T_STRING object (NotImplementedError)

Bug #2965: method `===’ called on hidden T_STRING object
(NotImplementedError)
http://redmine.ruby-lang.org/issues/show/2965

e$B5/I<<Te(B: Kenta M.
e$B%9%F!<%?%9e(B: Open, e$BM%@hEYe(B: Normal
Target version: 1.9.2
ruby -v: ruby 1.9.2dev (2010-03-15 trunk 26937) [x86_64-darwin10.2.0]

termtter e$B$Ne(B 464948b77fb335140bcd6e2a76dddc8cac7620a9 e$BHG$re(B
ruby 1.9.2dev r26937
e$B$G<B9T$9$k$H0J2<$N$h$&$JNc30$,=P$F;_$^$j$^$9!#e(B

/Users/muraken/src/termtter.git/lib/termtter/client.rb:225:in
legacy_config_support': method===’ called on hidden T_STRING object
(0x00000100b0c6f0 flags=0x524805 klass=0x0) (NotImplementedError)
from
/Users/muraken/src/termtter.git/lib/termtter/client.rb:216:in
load_config' from /Users/muraken/src/termtter.git/lib/termtter/client.rb:306:inrun’
from bin/termtter:14:in `’

e$B$3$l$Oe(B termtter e$B$N%P%0$G$7$g$&$+!)e(B
e$B$=$l$H$be(B ruby e$B$N%P%0$G$7$g$&$+!)e(B

e$B0J2<$O!"$3$NNc30$,=P$?>l=j$G%9%?%C%/%H%l!<%9$r=P$7$F$_$?7k2L$G$9!#e(B
Breakpoint 1, rb_exc_raise (mesg=4312823520) at
…/…/src/ruby.git/eval.c:450
450 if (!NIL_P(mesg)) {
1: rb_p (mesg) = #<NotImplementedError: method `===’ called on hidden
T_STRING object (0x00000100acdab8 flags=0x524805 klass=0x0)>
void
(gdb) where
#0 rb_exc_raise (mesg=4312823520) at …/…/src/ruby.git/eval.c:450
#1 0x000000010003e87c in rb_raise (exc=4303971640, fmt=<value
temporarily unavailable, due to optimizations>) at
…/…/src/ruby.git/error.c:1172
#2 0x0000000100191569 in rb_funcall (recv=4306295480, mid=<value
temporarily unavailable, due to optimizations>, n=1) at vm_eval.c:357
#3 0x0000000100191efd in opt_case_dispatch_i (key=<value temporarily
unavailable, due to optimizations>, data=57, p=140734799800224) at
vm_insnhelper.c:1664
#4 0x0000000100119750 in st_foreach (table=0x101e8da40,
func=0x100191ec0 <opt_case_dispatch_i>, arg=140734799800224) at
…/…/src/ruby.git/st.c:778
#5 0x0000000100189001 in vm_exec_core (th=0x1003016b0, initial=<value
temporarily unavailable, due to optimizations>) at insns.def:1257
#6 0x0000000100189f13 in vm_exec (th=0x1003016b0) at
…/…/src/ruby.git/vm.c:1132
#7 0x000000010018a220 in rb_iseq_eval_main (iseqval=4303729800) at
…/…/src/ruby.git/vm.c:1373
#8 0x0000000100042b32 in ruby_exec_internal (n=0x10085b488) at
…/…/src/ruby.git/eval.c:204
#9 0x00000001000459d4 in ruby_exec_node [inlined] () at
/Users/muraken/src/ruby.git/eval.c:251
#10 0x00000001000459d4 in ruby_run_node (n=<value temporarily
unavailable, due to optimizations>) at …/…/src/ruby.git/eval.c:244
#11 0x0000000100000ef0 in main (argc=3, argv=0x7fff5fbfeae8) at
…/…/src/ruby.git/main.c:35

e$B%A%1%C%He(B #2965 e$B$,99?7$5$l$^$7$?!#e(B (by Kenta M.)

String#=== e$B$r:[email protected]$1$G:F8=$G$-$^$7$?!#e(B

$ ruby -ve ’
class String
def ===(other)
self == other
end
end
case “”
when “”
end’
ruby 1.9.2dev (2010-03-15 trunk 26937) [x86_64-darwin10.2.0]
-e:3: warning: method redefined; discarding old ===
-e:7:in <main>': method===’ called on hidden T_STRING object
(0x0000010085be60 flags=0x500805 klass=0x0) (NotImplementedError)

http://redmine.ruby-lang.org/issues/show/2965

e$B%A%1%C%He(B #2965 e$B$,99?7$5$l$^$7$?!#e(B (by Sora H.)

e$B%=%i$G$9!#e(B
1.9.2deve$B$He(B1.9.1e$B$GNc30%a%C%;!<%8$,0[$J$k$h$&$G$9!#;29M$K$b!#e(B

% ruby -ve ’
class String
def ===(other)
self == other
end
end
case “”
when “”
end’
ruby 1.9.1p378 (2010-01-10 revision 26273) [i386-darwin10.2.0]
-e:3: warning: method redefined; discarding old ===
-e:7:in <main>': method===’ called on terminated object
(0x00000101028870) (NotImplementedError)

% ruby192 -ve e$B!Ge(B
class String
def ===(other)
self == other
end
end
case “”
when “”
end’
ruby 1.9.2dev (2010-03-15 trunk 26939) [x86_64-darwin10.2.0]
-e:3: warning: method redefined; discarding old ===
-e:7:in <main>': method===’ called on hidden T_STRING object
(0x0000010085c4c8 flags=0x500805 klass=0x0) (NotImplementedError)

http://redmine.ruby-lang.org/issues/show/2965

e$B%A%1%C%He(B #2965 e$B$,99?7$5$l$^$7$?!#e(B (by Kenta M.)

1.9.2dev e$B$O0J2<$Ne(B patch e$B$GD>$j$^$7$?!#e(B
[email protected]$NJ}[email protected]$,@5$7$1$l$P%3%_%C%H$7$^$9!#e(B
e$BG!2?$G$7$g$&!)e(B

diff --git a/compile.c b/compile.c
index 1db4e9c…b47999b 100644
— a/compile.c
+++ b/compile.c
@@ -4426,7 +4426,7 @@ iseq_compile_each(rb_iseq_t *iseq, LINK_ANCHOR
*ret, NODE * node, int poped)
case NODE_STR:{
debugp_param(“nd_lit”, node->nd_lit);
if (!poped) {

  •  hide_obj(node->nd_lit);
    
  •  OBJ_FREEZE(node->nd_lit);
     ADD_INSN1(ret, nd_line(node), putstring, node->nd_lit);
    
    }
    break;

http://redmine.ruby-lang.org/issues/show/2965

e$B%A%1%C%He(B #2965 e$B$,99?7$5$l$^$7$?!#e(B (by Shyouhei U.)

e$B$$$d!"$3$3$O>.<[email protected][email protected]$G$O$J$/[email protected]_7W$5$l$F$$$k$Y$-=j$G$9!#e(B
#[email protected][email protected]$/$H$h$$$N$G$9$,!"%j%F%i%k$NJ8;zNs$,e(BObjectSpacee$B$+$iO.$l$A$c$&$h$H$$$&LdBj$,$"$C$F!"e(B

  1. freezee$B$9$l$P$$$$$8$c$se(B
  2. e$B$=$b$=$be(BObjectSpacee$B$+$i8+$($F$$$k$N$O:,K\E*$K$^$:$$e(B

e$B$H$$$&<gD%$,Ah$C$?7k2L!“8=:_$Oe(B2e$B$r:NMQ$7$F$$$k$N$G$9$M!#$7$?$,$C$Fe(B1e$B$K;}$C$F$$$/$J$i$^$:!Ve(B2e$B$,$+$C$3$$$$!W$H$9$k$^[email protected]@$9$k$J$I$NI,MW$,$”$j$^$9!#e(B

e$B$"$H2>$Ke(B1e$B$K?6$k$J$i$=$NB>$Ne(Bhide_obje$B$7$F$$$k2U=j$r$I$&$9$k$Y$-$+$b9MN8$NBP>]$K$J$k$G$7$g$&!#e(B

http://redmine.ruby-lang.org/issues/show/2965

e$B%A%1%C%He(B #2965 e$B$,99?7$5$l$^$7$?!#e(B (by Shyouhei U.)

putstringe$B$N%%Z%i%s%I$re(BVALUEe$B$8$c$J$$2?$+$K$9$l$P$$$$$s$8$c$J$$$G$9$+e(B?
void
, size_t, rb_encoding* e$B$Ne(Btuplee$B$H$+!#e(B

http://redmine.ruby-lang.org/issues/show/2965

2010e$BG/e(B3e$B7ne(B16e$BF|e(B10:23 SASADA Koichi [email protected]:

  1. freezee$B$9$l$P$$$$$8$c$se(B
  2. e$B$=$b$=$be(BObjectSpacee$B$+$i8+$($F$$$k$N$O:,K\E*$K$^$:$$e(B

e$B$H$$$&<gD%$,Ah$C$?7k2L!“8=:_$Oe(B2e$B$r:NMQ$7$F$$$k$N$G$9$M!#$7$?$,$C$Fe(B1e$B$K;}$C$F$$$/$J$i$^$:!Ve(B2e$B$,$+$C$3$$$$!W$H$9$k$^[email protected]@$9$k$J$I$NI,MW$,$”$j$^$9!#e(B

e$B$"$H2>$Ke(B1e$B$K?6$k$J$i$=$NB>$Ne(Bhide_obje$B$7$F$$$k2U=j$r$I$&$9$k$Y$-$+$b9MN8$NBP>]$K$J$k$G$7$g$&!#e(B

e$B!!e(B1 e$B$G$bLdBjL5$$$h$&$J5$$,$9$k$N$G!$e(B1 e$B$KE}0l$9$k$N$O$I$&$G$7$g$&$+!%e(B2
e$B$O!$;d$b$+$C$3$$$$$H;W$&$N$G$9$,!$463PE*$K$=$&;W$&[email protected]$O$J$5$=$&$Ke(B
e$B;W$$$^$9!%$9$G$K$3$&$$$&:$$C$?Nc$b=P$F$-$F$$$k$o$1$G$9$7!%e(B

e$B$3$N%1!<%9$K$D$$$F$=$&$+$O$o$+$j$^$;$s$,!"e(B
e$B8e$+$iJQ99$9$k%1!<%9$G$Oe(B freeze e$B$G$O$&$^$/$J$$$G$9$M!#e(B

e$B$=$&$$$&$b$N$,$"$C$?>l9g$Oe(B 1
e$B$GE}0l$9$k$3$H$O$G$-$J$5$=$&$G$9!#e(B

[email protected]$G$9!%e(B

(2010/03/16 8:21), Shyouhei U. wrote::

e$B$$$d!"$3$3$O>.<[email protected][email protected]$G$O$J$/[email protected]_7W$5$l$F$$$k$Y$-=j$G$9!#e(B
#[email protected][email protected]$/$H$h$$$N$G$9$,!"%j%F%i%k$NJ8;zNs$,e(BObjectSpacee$B$+$iO.$l$A$c$&$h$H$$$&LdBj$,$"$C$F!"e(B

  1. freezee$B$9$l$P$$$$$8$c$se(B
  2. e$B$=$b$=$be(BObjectSpacee$B$+$i8+$($F$$$k$N$O:,K\E*$K$^$:$$e(B

e$B$H$$$&<gD%$,Ah$C$?7k2L!“8=:_$Oe(B2e$B$r:NMQ$7$F$$$k$N$G$9$M!#$7$?$,$C$Fe(B1e$B$K;}$C$F$$$/$J$i$^$:!Ve(B2e$B$,$+$C$3$$$$!W$H$9$k$^[email protected]@$9$k$J$I$NI,MW$,$”$j$^$9!#e(B

e$B$"$H2>$Ke(B1e$B$K?6$k$J$i$=$NB>$Ne(Bhide_obje$B$7$F$$$k2U=j$r$I$&$9$k$Y$-$+$b9MN8$NBP>]$K$J$k$G$7$g$&!#e(B

e$B!!e(B1 e$B$G$bLdBjL5$$$h$&$J5$$,$9$k$N$G!$e(B1
e$B$KE}0l$9$k$N$O$I$&$G$7$g$&$+!%e(B2
e$B$O!$;d$b$+$C$3$$$$$H;W$&$N$G$9$,!$463PE*$K$=$&;W$&[email protected]$O$J$5$=$&$Ke(B
e$B;W$$$^$9!%$9$G$K$3$&$$$&:$$C$?Nc$b=P$F$-$F$$$k$o$1$G$9$7!%e(B

e$B%A%1%C%He(B #2965 e$B$,99?7$5$l$^$7$?!#e(B (by Kenta M.)

String e$B$K8B$i$:!"e(B=== e$B$,:[email protected]$1$GH/@8$7$^$9!#e(B
e$B1#$7%*%V%8%’%/%HMQ$N%a%=%C%I%F!<%V%k$,I,MW$J$s$8$c$J$$$G$7$g$&$+!)e(B

$ ruby -ve ’
class Float
def ===(x)
true
end
end
case true
when “”
end’
ruby 1.9.2dev (2010-03-17 trunk 26960) [x86_64-darwin10.2.0]
-e:1: warning: method redefined; discarding old ===
-e:1:in <main>': method===’ called on hidden T_STRING object
(0x00000100856f00 flags=0x500805 klass=0x0) (NotImplementedError)


http://redmine.ruby-lang.org/issues/show/2965

e$B%A%1%C%He(B #2965 e$B$,99?7$5$l$^$7$?!#e(B (by Shyouhei U.)

e$B%+%F%4%je(B coree$B$K%;%C%He(B
e$BM%@hEYe(B Normale$B$+$ie(BHighe$B$KJQ99e(B

e$BK\7o$Oe(B1.9.2e$B$^[email protected]$H;W$$$^$9!#e(B
e$B$$$m$$$m$J$d$jJ}$,$"$j$($=$&$G$9$,!“HqMQBP8z2L$G$$$&$H$H$j$”$($:e(Bfreezee$B$9$k$[$&$KA4ItE]$9$H$$$&$N$,8=<BE*$G$7$g$&$+!#e(B

http://redmine.ruby-lang.org/issues/show/2965

e$B$^$D$b$He(B e$B$f$-$R$m$G$9e(B

In message “Re: [ruby-dev:40877] [Bug #2965] method `===’ called on
hidden T_STRING object (NotImplementedError)”
on Wed, 31 Mar 2010 18:51:12 +0900, Shyouhei U.
[email protected] writes:

|e$BK\7o$Oe(B1.9.2e$B$^[email protected]$H;W$$$^$9!#e(B
|e$B$$$m$$$m$J$d$jJ}$,$"$j$($=$&$G$9$,!“HqMQBP8z2L$G$$$&$H$H$j$”$($:e(Bfreezee$B$9$k$[$&$KA4ItE]$9$H$$$&$N$,8=<BE*$G$7$g$&$+!#e(B

e$B;[email protected]$7$^$9!#e(B

e$B%A%1%C%He(B #2965 e$B$,99?7$5$l$^$7$?!#e(B (by Kenta M.)

e$B%9%F!<%?%9e(B Opene$B$+$ie(BClosede$B$KJQ99e(B

[ruby-dev:40647] e$B$GDs<($7$?%Q%C%A$rE,MQ$7$F%3%_%C%H$7$^$7$?!#e(B


http://redmine.ruby-lang.org/issues/show/2965

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs