From 1ca4fdc4c7cdf874eb93d4fad2d9688b0490fa52 Mon Sep 17 00:00:00 2001 From: dearblue Date: Sat, 7 Dec 2019 22:48:58 +0900 Subject: Fix keyword arguments not be obtained with `mrb_get_args()`; Fix #4754 If ":" is after "|" and there is no "?" or "*", the keyword argument could not be obtained and it was not initialized with `undef`. For example: "|oo:" --- src/class.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/class.c') diff --git a/src/class.c b/src/class.c index e731fde59..262934dd8 100644 --- a/src/class.c +++ b/src/class.c @@ -620,11 +620,11 @@ mrb_get_args(mrb_state *mrb, const char *format, ...) goto check_exit; case '!': break; - case '&': case '?': - if (opt) opt_skip = FALSE; - break; case ':': reqkarg = TRUE; + /* fall through */ + case '&': case '?': + if (opt) opt_skip = FALSE; break; default: if (!opt) needargc ++; -- cgit v1.2.3