Skip non string values in backtraces; ref #3408

This commit is contained in:
Yukihiro "Matz" Matsumoto
2017-01-23 16:22:55 +09:00
parent 40ec03c8c2
commit 28b7b9ec64
+3 -1
View File
@@ -219,7 +219,9 @@ print_backtrace(mrb_state *mrb, mrb_value backtrace)
for (i = 0; i < n; i++) {
mrb_value entry = RARRAY_PTR(backtrace)[i];
fprintf(stream, "\t[%d] %.*s\n", i, (int)RSTRING_LEN(entry), RSTRING_PTR(entry));
if (mrb_string_p(entry)) {
fprintf(stream, "\t[%d] %.*s\n", i, (int)RSTRING_LEN(entry), RSTRING_PTR(entry));
}
}
}