Forum: Ruby-core [Assigned] stack overflow on super

Posted by mame (Yusuke Endoh) (Guest)
on 2012-12-09 16:29
(Received via mailing list)
Issue #3351 has been updated by mame (Yusuke Endoh).

Status changed from Open to Assigned
Assignee changed from ko1 (Koichi Sasada) to shugo (Shugo Maeda)

Shugo-san, ko1, what's the status?
Do you think this issue important?

--
Yusuke Endoh <mame@tsg.ne.jp>
----------------------------------------
Bug #3351: stack overflow on super
https://bugs.ruby-lang.org/issues/3351#change-34563

Author: serge_balyuk (Serge Balyuk)
Status: Assigned
Priority: Low
Assignee: shugo (Shugo Maeda)
Category: core
Target version: 2.0.0
ruby -v: ruby 1.9.3dev (2010-05-26 trunk 28028) [i686-linux]


=begin
 It looks like `super` behavior is a bit different in 1.8 and 1.9. 
Please find the example below:

 class Base
   def foo
     puts "bar"
   end
 end

 module Override
   def foo
     puts "override"
     super
   end
 end


 class A < Base
 end

 class B < A
 end

 B.send(:include, Override)
 A.send(:include, Override)

 B.new.foo

 ruby 1.8.7 (2009-06-12 patchlevel 174) [i486-linux] output:


 override
 override
 bar


 and ruby 1.9.3dev (2010-05-26 trunk 28028) [i686-linux] output:

 ....
 override
 override
 override
 override
 override
 super.rb:9: stack level too deep (SystemStackError)


 Hope that helps.
=end
Please log in before posting. Registration is free and takes only a minute.
Existing account (Switch to SSL-encrypted connection)
NEW: Do you have a Google/GoogleMail or Yahoo account? No registration required!
Log in with Google account | Log in with Yahoo account
No account? Register here.