Commit 6491693d authored by Yukihiro Matsumoto's avatar Yukihiro Matsumoto

mrb_get_args("&") gave wrong value

parent cc0f249c
......@@ -602,12 +602,15 @@ mrb_get_args(mrb_state *mrb, const char *format, ...)
case '&':
{
mrb_value *p, *bp = mrb->stack + 1;
mrb_value *p, *bp;
p = va_arg(ap, mrb_value*);
if (mrb->ci->argc > 0) {
bp += mrb->ci->argc;
if (mrb->ci->argc < 0) {
bp = mrb->stack + 2;
}
else {
bp = mrb->stack + mrb->ci->argc + 1;
}
*p = *bp;
}
break;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment