summaryrefslogtreecommitdiffhomepage
path: root/src
diff options
context:
space:
mode:
authordearblue <[email protected]>2019-12-07 22:48:58 +0900
committerdearblue <[email protected]>2019-12-07 22:48:58 +0900
commit1ca4fdc4c7cdf874eb93d4fad2d9688b0490fa52 (patch)
tree5be113605ee7569372faa2dc080da93ea24ac11a /src
parent6e5c861ffffc9b031cd6ef882286b709fd320a81 (diff)
downloadmruby-1ca4fdc4c7cdf874eb93d4fad2d9688b0490fa52.tar.gz
mruby-1ca4fdc4c7cdf874eb93d4fad2d9688b0490fa52.zip
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:"
Diffstat (limited to 'src')
-rw-r--r--src/class.c6
1 files changed, 3 insertions, 3 deletions
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 ++;