Project

General

Profile

Backport #8188

Wrong warning about __attached__

Added by marcandre (Marc-Andre Lafortune) almost 6 years ago. Updated almost 6 years ago.

Status:
Closed
Priority:
Normal
[ruby-core:<unknown>]

Description

ruby -w -e "ARGF.singleton_class.instance_eval{}"

=> warning: instance variable attached not initialized

Here's the test, but I'm not sure how to fix. Should rb_ivar_get(..., id_attached) replaced with rb_attr_get?

diff --git a/test/ruby/test_eval.rb b/test/ruby/test_eval.rb
index 580d3e8..8e3bd8c 100644
--- a/test/ruby/test_eval.rb
+++ b/test/ruby/test_eval.rb
@@ -215,6 +215,12 @@ class TestEval < Test::Unit::TestCase
     end
   end

+  def test_instance_eval_on_argf_singleton_class
+    assert_warning('', '[ruby-core:xxx]') do
+      ARGF.singleton_class.instance_eval{}
+    end
+  end
+
   class Foo
     Bar = 2
   end

Associated revisions

Revision c5fe7eb6
Added by nobu (Nobuyoshi Nakada) almost 6 years ago

class.c: suppress wrong warning

  • class.c (HAVE_METACLASS_P): should check FL_SINGLTON flag before get instance variable to get rid of wrong warning about attached. [ruby-core:53839] [Bug #8188]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40013 b2dd03c8-39d4-4d8f-98ff-823fe69b080e

Revision 40013
Added by nobu (Nobuyoshi Nakada) almost 6 years ago

class.c: suppress wrong warning

  • class.c (HAVE_METACLASS_P): should check FL_SINGLTON flag before get instance variable to get rid of wrong warning about attached. [ruby-core:53839] [Bug #8188]

Revision 40013
Added by nobu (Nobuyoshi Nakada) almost 6 years ago

class.c: suppress wrong warning

  • class.c (HAVE_METACLASS_P): should check FL_SINGLTON flag before get instance variable to get rid of wrong warning about attached. [ruby-core:53839] [Bug #8188]

Revision 40013
Added by nobu (Nobuyoshi Nakada) almost 6 years ago

class.c: suppress wrong warning

  • class.c (HAVE_METACLASS_P): should check FL_SINGLTON flag before get instance variable to get rid of wrong warning about attached. [ruby-core:53839] [Bug #8188]

Revision 40013
Added by nobu (Nobuyoshi Nakada) almost 6 years ago

class.c: suppress wrong warning

  • class.c (HAVE_METACLASS_P): should check FL_SINGLTON flag before get instance variable to get rid of wrong warning about attached. [ruby-core:53839] [Bug #8188]

Revision 40013
Added by nobu (Nobuyoshi Nakada) almost 6 years ago

class.c: suppress wrong warning

  • class.c (HAVE_METACLASS_P): should check FL_SINGLTON flag before get instance variable to get rid of wrong warning about attached. [ruby-core:53839] [Bug #8188]

Revision 40013
Added by nobu (Nobuyoshi Nakada) almost 6 years ago

class.c: suppress wrong warning

  • class.c (HAVE_METACLASS_P): should check FL_SINGLTON flag before get instance variable to get rid of wrong warning about attached. [ruby-core:53839] [Bug #8188]

Revision c6c33ec6
Added by nagachika (Tomoyuki Chikanaga) almost 6 years ago

merge revision(s) 40013,40032: [Backport #8188]

* class.c (HAVE_METACLASS_P): should check FL_SINGLTON flag before get
  instance variable to get rid of wrong warning about __attached__.
  [ruby-core:53839] [Bug #8188]

* class.c (HAVE_METACLASS_P): should check FL_SINGLETON flag before get

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_0_0@40294 b2dd03c8-39d4-4d8f-98ff-823fe69b080e

Revision 40294
Added by nagachika (Tomoyuki Chikanaga) almost 6 years ago

merge revision(s) 40013,40032: [Backport #8188]

* class.c (HAVE_METACLASS_P): should check FL_SINGLTON flag before get
  instance variable to get rid of wrong warning about __attached__.
  [ruby-core:53839] [Bug #8188]

* class.c (HAVE_METACLASS_P): should check FL_SINGLETON flag before get

History

#1

Updated by nobu (Nobuyoshi Nakada) almost 6 years ago

  • Status changed from Open to Closed
  • % Done changed from 0 to 100

This issue was solved with changeset r40013.
Marc-Andre, thank you for reporting this issue.
Your contribution to Ruby is greatly appreciated.
May Ruby be with you.


class.c: suppress wrong warning

  • class.c (HAVE_METACLASS_P): should check FL_SINGLTON flag before get instance variable to get rid of wrong warning about attached. [ruby-core:53839] [Bug #8188]
#2

Updated by nobu (Nobuyoshi Nakada) almost 6 years ago

  • Tracker changed from Bug to Backport
  • Project changed from Ruby trunk to Backport200
  • Category deleted (core)
  • Status changed from Closed to Assigned
  • Assignee set to nagachika (Tomoyuki Chikanaga)
  • Target version deleted (2.1.0)
#3

Updated by nagachika (Tomoyuki Chikanaga) almost 6 years ago

  • Status changed from Assigned to Closed

This issue was solved with changeset r40294.
Marc-Andre, thank you for reporting this issue.
Your contribution to Ruby is greatly appreciated.
May Ruby be with you.


merge revision(s) 40013,40032: [Backport #8188]

* class.c (HAVE_METACLASS_P): should check FL_SINGLTON flag before get
  instance variable to get rid of wrong warning about __attached__.
  [ruby-core:53839] [Bug #8188]

* class.c (HAVE_METACLASS_P): should check FL_SINGLETON flag before get

Also available in: Atom PDF