Project

General

Profile

Bug #576

Segfault if Class.new is aliased

Added by jredville (Jim Deville) almost 11 years ago. Updated over 8 years ago.

Status:
Closed
Priority:
Normal
Target version:
-
ruby -v:
ruby 1.8.7 (2009-02-01 revision 21927) [i686-linux]
[ruby-core:18749]

Description

=begin
By aliasing Class.new, one can get around the lack of MatchData.new (and presumably other hidden new methods). If one uses this to try and create a new MatchData, and then calls an instance method of the new MatchData object, Ruby segfaults. This has been tested and reproduced on Ruby 1.8.6p111 and Ruby 1.8.6 HEAD.
=end


Files

temp.rb (99 Bytes) temp.rb Example code jredville (Jim Deville), 09/20/2008 05:49 AM

History

#1

Updated by akr (Akira Tanaka) over 10 years ago

  • ruby -v set to ruby 1.8.7 (2009-02-01 revision 21927) [i686-linux]

=begin
It is reproducible without alias:

% ruby-1.8 -ve 'MatchData.allocate.pre_match'
ruby 1.8.7 (2009-02-01 revision 21927) [i686-linux]
-e:1: [BUG] Segmentation fault
ruby 1.8.7 (2009-02-01 revision 21927) [i686-linux]

=end

#2

Updated by shyouhei (Shyouhei Urabe) over 10 years ago

  • Assignee set to matz (Yukihiro Matsumoto)

=begin

=end

#3

Updated by matz (Yukihiro Matsumoto) over 10 years ago

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

=begin
Applied in changeset r21997.
=end

Also available in: Atom PDF