Project

General

Profile

Actions

Bug #14279

closed

Modifying splat argument causes segmentation fault

Added by coreycerovsek (Corey Cerovsek) over 4 years ago. Updated about 4 years ago.

Status:
Closed
Priority:
Normal
Assignee:
-
Target version:
-
ruby -v:
ruby 2.5.0rc1 (2017-12-14 trunk 61243) [x86_64-linux]
[ruby-core:84622]

Description

Using Docker Ruby images ruby:2.2 through ruby:rc as of 2018-01-03, this little bit of code causes a segmentation fault:

class A 
  def x(*args)
    args = 13
    super
  end
end
A.new.x

I'm not sure what the behavior of super ought to be here, and it doesn't seem to be addressed by The Ruby Spec Suite, but with Ruby 2.1 (Docker ruby:2.1) this causes a "no superclass method" exception rather than crashing the interpreter. I'm guessing this has to do with the optimization in https://bugs.ruby-lang.org/issues/10440

Actions

Also available in: Atom PDF