Should not call to_str in mrb_vformat; fix #3773

This commit is contained in:
Yukihiro "Matz" Matsumoto
2017-08-11 09:21:47 +09:00
parent 68470bef86
commit 3e075a7b6c
+4 -1
View File
@@ -269,9 +269,12 @@ mrb_vformat(mrb_state *mrb, const char *format, va_list ap)
if (c == '%') {
if (*p == 'S') {
mrb_value val;
size = p - b - 1;
mrb_ary_push(mrb, ary, mrb_str_new(mrb, b, size));
mrb_ary_push(mrb, ary, va_arg(ap, mrb_value));
val = va_arg(ap, mrb_value);
mrb_ary_push(mrb, ary, mrb_obj_as_string(mrb, val));
b = p + 1;
}
}