mirror of
https://github.com/mruby/mruby
synced 2026-06-08 16:11:16 +00:00
avoid infinite recursion when error was happened in #inspect; fix #2474
This commit is contained in:
+1
-1
@@ -1206,7 +1206,7 @@ mrb_bob_missing(mrb_state *mrb, mrb_value mod)
|
||||
/* method missing in inspect; avoid recursion */
|
||||
repr = mrb_any_to_s(mrb, mod);
|
||||
}
|
||||
else if (mrb_respond_to(mrb, mod, inspect)) {
|
||||
else if (mrb_respond_to(mrb, mod, inspect) && mrb->c->ci - mrb->c->cibase < 64) {
|
||||
repr = mrb_funcall_argv(mrb, mod, inspect, 0, 0);
|
||||
if (RSTRING_LEN(repr) > 64) {
|
||||
repr = mrb_any_to_s(mrb, mod);
|
||||
|
||||
Reference in New Issue
Block a user