Actions
Bug #11663
closedSegfault 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
Updated by nobu (Nobuyoshi Nakada) almost 9 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) almost 9 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) almost 9 years ago
- Related to Feature #10440: Optimize keyword and splat argument added
Updated by nobu (Nobuyoshi Nakada) almost 9 years ago
- Related to Bug #10545: SEGV: def m(A: a) end added
Updated by nagachika (Tomoyuki Chikanaga) over 8 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.
Actions
Like0
Like0Like0Like0Like0Like0