diff options
author | nagachika <nagachika@ruby-lang.org> | 2020-09-06 10:54:53 +0900 |
---|---|---|
committer | nagachika <nagachika@ruby-lang.org> | 2020-09-06 10:54:53 +0900 |
commit | e778de2c82478dda930cfc8d795ed4e0e60ea775 (patch) | |
tree | d0e8f69cc745df91f9de8a59d9d5e1fbdeb4f087 /compile.c | |
parent | 9a1f0240cae95df4207bd95e7c0380d5307b7c9e (diff) |
merge revision(s) 11963da9e8e98821860fbb0c0f2adc118860c814: [Backport #16603] [Backport #17141]
Check type of empty keyword [Bug #16603]
Co-authored-by: Yusuke Endoh <mame@ruby-lang.org>
Diffstat (limited to 'compile.c')
-rw-r--r-- | compile.c | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -4241,7 +4241,7 @@ compile_hash(rb_iseq_t *iseq, LINK_ANCHOR *const ret, const NODE *node, int popp FLUSH_CHUNK(); const NODE *kw = node->nd_next->nd_head; - int empty_kw = nd_type(kw) == NODE_LIT; /* foo( ..., **{}, ...) */ + int empty_kw = nd_type(kw) == NODE_LIT && RB_TYPE_P(kw->nd_lit, T_HASH); /* foo( ..., **{}, ...) */ int first_kw = first_chunk && stack_len == 0; /* foo(1,2,3, **kw, ...) */ int last_kw = !node->nd_next->nd_next; /* foo( ..., **kw) */ int only_kw = last_kw && first_kw; /* foo(1,2,3, **kw) */ |