diff options
| author | Yukihiro "Matz" Matsumoto <[email protected]> | 2019-06-25 18:06:39 +0900 |
|---|---|---|
| committer | Yukihiro "Matz" Matsumoto <[email protected]> | 2019-06-25 18:07:48 +0900 |
| commit | 6724416d5c6289a1e7bd8e0fd0be7d86b6166f93 (patch) | |
| tree | 8668c625d6baaf3789f5c3fa5a8d0b355e15348a | |
| parent | dc21024ec795bcfcd3018825fa3c272731439a7e (diff) | |
| download | mruby-6724416d5c6289a1e7bd8e0fd0be7d86b6166f93.tar.gz mruby-6724416d5c6289a1e7bd8e0fd0be7d86b6166f93.zip | |
Fixed a bug caused by `to_s` that returns `nil`; fix 4504
| -rw-r--r-- | mrbgems/mruby-method/src/method.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/mrbgems/mruby-method/src/method.c b/mrbgems/mruby-method/src/method.c index 9f1134227..d94db1cb2 100644 --- a/mrbgems/mruby-method/src/method.c +++ b/mrbgems/mruby-method/src/method.c @@ -270,16 +270,16 @@ method_to_s(mrb_state *mrb, mrb_value self) mrb_str_cat_lit(mrb, str, ": "); rklass = mrb_class_ptr(klass); if (mrb_class_ptr(owner) == rklass) { - mrb_str_cat_str(mrb, str, mrb_funcall(mrb, owner, "to_s", 0)); + mrb_str_cat_str(mrb, str, mrb_str_to_str(mrb, owner)); mrb_str_cat_lit(mrb, str, "#"); - mrb_str_cat_str(mrb, str, mrb_funcall(mrb, name, "to_s", 0)); + mrb_str_cat_str(mrb, str, mrb_str_to_str(mrb, name)); } else { mrb_str_cat_cstr(mrb, str, mrb_class_name(mrb, rklass)); mrb_str_cat_lit(mrb, str, "("); - mrb_str_cat_str(mrb, str, mrb_funcall(mrb, owner, "to_s", 0)); + mrb_str_cat_str(mrb, str, mrb_str_to_str(mrb, owner)); mrb_str_cat_lit(mrb, str, ")#"); - mrb_str_cat_str(mrb, str, mrb_funcall(mrb, name, "to_s", 0)); + mrb_str_cat_str(mrb, str, mrb_str_to_str(mrb, name)); } mrb_str_cat_lit(mrb, str, ">"); return str; |
