ruby-core@ruby-lang.org archive (unofficial mirror)
 help / color / mirror / Atom feed
From: nagachika00@gmail.com
To: ruby-core@ruby-lang.org
Subject: [ruby-core:71656] [Ruby trunk - Bug #11663] Segfault when using multiple keywords if the first keyword is invalid
Date: Tue, 24 Nov 2015 16:03:18 +0000	[thread overview]
Message-ID: <redmine.journal-55061.20151124160317.0379934924ed6b3b@ruby-lang.org> (raw)
In-Reply-To: redmine.issue-11663.20151105212324@ruby-lang.org

Issue #11663 has been updated by Tomoyuki Chikanaga.

Backport changed from 2.0.0: DONTNEED, 2.1: DONTNEED, 2.2: REQUIRED to 2.0.0: DONTNEED, 2.1: DONTNEED, 2.2: DONE

Backported into `ruby_2_2` branch at r52742.

----------------------------------------
Bug #11663: Segfault when using multiple keywords if the first keyword is invalid
https://bugs.ruby-lang.org/issues/11663#change-55061

* Author: Sean MacGahan
* Status: Closed
* Priority: Normal
* Assignee: 
* ruby -v: 2.2.3
* Backport: 2.0.0: DONTNEED, 2.1: DONTNEED, 2.2: DONE
----------------------------------------
When loading a method with an invalid keyword (such as one that ends in a question mark), a syntax error occurs as is expected. However, when loading a method with multiple keywords, if the first keyword is invalid then a segmentation fault occurs.

```ruby
def foo(arg1?:) end         #=> syntax error
def foo(arg1?:, arg2) end   #=> syntax error (tIDENTIFIER as expected)
def foo(arg1:) end          #=> no syntax error
def foo(arg1:, arg2?:) end  #=> syntax error
def foo(arg1, arg2?:) end   #=> syntax error

def foo(arg1?:, arg2:) end  #=> segfault
def foo(arg1?:, arg2?:) end #=> segfault
```



-- 
https://bugs.ruby-lang.org/

      parent reply	other threads:[~2015-11-24 15:32 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <redmine.issue-11663.20151105212324@ruby-lang.org>
2015-11-05 21:23 ` [ruby-core:71356] [Ruby trunk - Bug #11663] [Open] Segfault when using multiple keywords if the first keyword is invalid smacgaha
2015-11-06  0:04 ` [ruby-core:71362] [Ruby trunk - Bug #11663] " nobu
2015-11-24 16:03 ` nagachika00 [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-list from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.ruby-lang.org/en/community/mailing-lists/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=redmine.journal-55061.20151124160317.0379934924ed6b3b@ruby-lang.org \
    --to=ruby-core@ruby-lang.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).