Bug #11663
Segfault when using multiple keywords if the first keyword is invalid
Description
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.
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
Related issues
Associated revisions
parse.y: fix segv after invalid keyword argument
- parse.y (kwd_append): fix segv after invalid keyword argument, preceding keyword list is NULL when syntax error is there. [ruby-core:71356] [Bug #11663]
parse.y: fix segv after invalid keyword argument
- parse.y (kwd_append): fix segv after invalid keyword argument, preceding keyword list is NULL when syntax error is there. [ruby-core:71356] [Bug #11663]
parse.y: fix segv after invalid keyword argument
- parse.y (kwd_append): fix segv after invalid keyword argument, preceding keyword list is NULL when syntax error is there. [ruby-core:71356] [Bug #11663]
parse.y: fix segv after invalid keyword argument
- parse.y (kwd_append): fix segv after invalid keyword argument, preceding keyword list is NULL when syntax error is there. [ruby-core:71356] [Bug #11663]
parse.y: fix segv after invalid keyword argument
- parse.y (kwd_append): fix segv after invalid keyword argument, preceding keyword list is NULL when syntax error is there. [ruby-core:71356] [Bug #11663]
merge revision(s) 52461: [Backport #11663]
* parse.y (kwd_append): fix segv after invalid keyword argument, preceding keyword list is NULL when syntax error is there. [ruby-core:71356] [Bug #11663]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_2@52742 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
merge revision(s) 52461: [Backport #11663]
* parse.y (kwd_append): fix segv after invalid keyword argument, preceding keyword list is NULL when syntax error is there. [ruby-core:71356] [Bug #11663]
History
Updated by nobu (Nobuyoshi Nakada) about 4 years ago
- Status changed from Open to Closed
Applied in changeset r52461.
parse.y: fix segv after invalid keyword argument
- parse.y (kwd_append): fix segv after invalid keyword argument, preceding keyword list is NULL when syntax error is there. [ruby-core:71356] [Bug #11663]
Updated by nobu (Nobuyoshi Nakada) about 4 years ago
- Description updated (diff)
- Backport changed from 2.0.0: UNKNOWN, 2.1: UNKNOWN, 2.2: UNKNOWN to 2.0.0: DONTNEED, 2.1: DONTNEED, 2.2: REQUIRED
Updated by nobu (Nobuyoshi Nakada) about 4 years ago
- Related to Feature #10440: Optimize keyword and splat argument added
Updated by nobu (Nobuyoshi Nakada) about 4 years ago
- Related to Bug #10545: SEGV: def m(A: a) end added
Updated by nagachika (Tomoyuki Chikanaga) about 4 years ago
- 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.
parse.y: fix segv after invalid keyword argument
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52461 b2dd03c8-39d4-4d8f-98ff-823fe69b080e