Issue #4926 has been reported by Kazuki Tsujimoto.

----------------------------------------
Bug #4926: --gc-stress????test/ruby/enc/test_emoji.rb???失????????
http://redmine.ruby-lang.org/issues/4926

Author: Kazuki Tsujimoto
Status: Open
Priority: Normal
Assignee: 
Category: core
Target version: 
ruby -v: ruby 1.9.3dev (2011-06-26 trunk 32229) [x86_64-linux]


=begin
辻???????

--gc-stress?????????????????test/ruby/enc/test_emoji.rb?????????????????????失?????????????

 $ make RUBYOPT=-W TESTS='ruby/enc/test_emoji.rb --gc-stress' test-all
 /home/k_tsj/work/ruby-trunk/test/ruby/enc/test_emoji.rb:154: warning: instance variable @aiueo_sjis not initialized
   1) Failure:
 test_from_iso2022jp(Emoji::TestKDDI) [/home/k_tsj/work/ruby-trunk/test/ruby/enc/test_emoji.rb:154]:
 Exception raised:
 <#<NoMethodError: undefined method `force_encoding' for nil:NilClass>>.
 (???????????添???????????)

????????????????以???????????????

(1) vm_setivar????ic->ic_class???RBASIC(obj)->klass(Emoji::TestDoCoMo??????????????????)???代????????????
(2) 1.?????????GC??解?????????????
(3) Emoji::TestKDDI???????????????????1.??????????????????????????????????????
(4) ic???index???klass???index?????????起???????????????????????失????????????

ivar_get/rb_ivar_set????RBASIC(obj)->klass??????rb_obj_class(obj)???使???IV_INDEX_TBL???????????????
???????????????????????起?????????????????以?????????????????????????????????

 diff --git a/vm_insnhelper.c b/vm_insnhelper.c
 index 366ac4a..3736055 100644
 --- a/vm_insnhelper.c
 +++ b/vm_insnhelper.c
 @@ -1259,7 +1259,7 @@ vm_getivar(VALUE obj, ID id, IC ic)
  #if USE_IC_FOR_IVAR
      if (TYPE(obj) ==  T_OBJECT) {
  	VALUE val = Qundef;
 -	VALUE klass = RBASIC(obj)->klass;
 +	VALUE klass = rb_obj_class(obj);
  
  	if (ic->ic_class == klass) {
  	    long index = ic->ic_value.index;
 @@ -1311,7 +1311,7 @@ vm_setivar(VALUE obj, ID id, VALUE val, IC ic)
      rb_check_frozen(obj);
  
      if (TYPE(obj) == T_OBJECT) {
 -	VALUE klass = RBASIC(obj)->klass;
 +	VALUE klass = rb_obj_class(obj);
  	st_data_t index;
  
  	if (ic->ic_class == klass) {
=end


-- 
http://redmine.ruby-lang.org