diff options
author | Jeremy Evans <code@jeremyevans.net> | 2019-09-27 09:35:51 -0700 |
---|---|---|
committer | Jeremy Evans <code@jeremyevans.net> | 2019-09-27 11:21:50 -0700 |
commit | 7814b6c6572446a6b64614e524d13dd423577004 (patch) | |
tree | 125375c31c9b3ca937b90a93d07795e6692c8414 /vm_insnhelper.c | |
parent | fd0e2141835a0ef98b31d0a6b23924413f8452d3 (diff) | |
download | ruby-7814b6c6572446a6b64614e524d13dd423577004.tar.gz |
Correctly issue ArgumentError when calling method that accepts no keywords
If a method accepts no keywords and was called with a keyword, an
ArgumentError was not always issued previously. Force methods that
accept no keywords to go through setup_parameters_complex so that
an ArgumentError is raised if keywords are provided.
Diffstat (limited to 'vm_insnhelper.c')
-rw-r--r-- | vm_insnhelper.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/vm_insnhelper.c b/vm_insnhelper.c index fdcf3d4584..4375a4827e 100644 --- a/vm_insnhelper.c +++ b/vm_insnhelper.c @@ -1743,6 +1743,7 @@ rb_simple_iseq_p(const rb_iseq_t *iseq) iseq->body->param.flags.has_post == FALSE && iseq->body->param.flags.has_kw == FALSE && iseq->body->param.flags.has_kwrest == FALSE && + iseq->body->param.flags.accepts_no_kwarg == FALSE && iseq->body->param.flags.has_block == FALSE; } @@ -1754,6 +1755,7 @@ rb_iseq_only_optparam_p(const rb_iseq_t *iseq) iseq->body->param.flags.has_post == FALSE && iseq->body->param.flags.has_kw == FALSE && iseq->body->param.flags.has_kwrest == FALSE && + iseq->body->param.flags.accepts_no_kwarg == FALSE && iseq->body->param.flags.has_block == FALSE; } |