Project

General

Profile

Bug #15087

Segmentation fault with splat and block

Added by jacobevelyn (Jacob Evelyn) 16 days ago. Updated 4 days ago.

Status:
Closed
Priority:
Normal
Assignee:
-
Target version:
-
ruby -v:
2.5.0, 2.5.1, 2.6.0dev (2018-09-07 trunk 64656)
[ruby-core:88890]

Description

The following code produces segmentation faults in Ruby 2.5.0, 2.5.1, and 2.6.0dev (2018-09-07 trunk 64656). This code worked in Ruby 2.4.1.

test_proc = Proc.new { "test" }
def foo(bar: 1, &block)
  yield
end
foo(**{}, &test_proc)

I've attached the crash reports for both Ruby 2.6.0dev (2018-09-07 trunk 64656) and 2.5.1. Let me know if there's anything else I can provide.


Related issues

Related to Ruby trunk - Bug #15052: must not optimize `foo(**{})` outOpen

Associated revisions

Revision d325d741
Added by nobu (Nobuyoshi Nakada) 4 days ago

parse.y: fix block passing with empty kwargs

  • parse.y (arg_blk_pass): preceeding arguments node may be NULL when an empty keyword argument hash splat is optimized away. [Bug #15087]

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

Revision 64786
Added by nobu (Nobuyoshi Nakada) 4 days ago

parse.y: fix block passing with empty kwargs

  • parse.y (arg_blk_pass): preceeding arguments node may be NULL when an empty keyword argument hash splat is optimized away. [Bug #15087]

History

#1 Updated by mame (Yusuke Endoh) 16 days ago

  • Related to Bug #15052: must not optimize `foo(**{})` out added

#2 [ruby-core:88891] Updated by mame (Yusuke Endoh) 16 days ago

Good catch. My patch for #15052 will fix this issue.

#3 [ruby-core:89087] Updated by mame (Yusuke Endoh) 4 days ago

mame (Yusuke Endoh) wrote:

Good catch. My patch for #15052 will fix this issue.

We have never agreed with how to fix #15052 yet. Nobu is working on this issue without behavior change.

#4 Updated by nobu (Nobuyoshi Nakada) 4 days ago

  • Status changed from Open to Closed

Applied in changeset trunk|r64786.


parse.y: fix block passing with empty kwargs

  • parse.y (arg_blk_pass): preceeding arguments node may be NULL when an empty keyword argument hash splat is optimized away. [Bug #15087]

Also available in: Atom PDF