Project

General

Profile

Actions

Backport #2233

closed

[PATCH] Ripper parsing Proc call as: f.() or f::() crashes

Added by akeep (Andy Keep) over 14 years ago. Updated almost 13 years ago.

Status:
Closed
[ruby-core:26165]

Description

=begin
Ripper seems to crash (with YARV and C stack trace) when trying to parse the two Proc call conveniences added to Ruby 1.9.x where the 'call' keyword is eliminated.

Ripper.sexp("f.()")

Ripper.sexp("f::()")

The problem seems to be that Ripper is inserting 'call' in the parse stream but was using rb_intern instead of ripper_intern. The included patch calls the ripper_intern and fixes the crash.

With the patch:

Ripper.sexp("f.()")
=> [:program, [[:method_add_arg, [:call, [:paren, [:var_ref, [:ident, "f", [1, 0]]]], :".", :call], [:arg_paren, nil]]]]
Ripper.sexp("f::()")
=> [:program, [[:method_add_arg, [:call, [:paren, [:var_ref, [:ident, "f", [1, 0]]]], :"::", :call], [:arg_paren, nil]]]]
=end


Files

parse.y.callless_call_patch (684 Bytes) parse.y.callless_call_patch Patch to fix Ripper handling of call-less calls (i.e. if f is a Proc, f.() and f::()) akeep (Andy Keep), 10/20/2009 01:13 AM
parse.y.callless_call_patch (810 Bytes) parse.y.callless_call_patch Patch to fix Ripper handling of call-less calls (i.e. if f is a Proc, f.() and f::()) akeep (Andy Keep), 10/20/2009 05:16 AM
Actions

Also available in: Atom PDF

Like0
Like0Like0Like0Like0