From dbffdff1e7eaf77711b3638e7734d1597d32d016 Mon Sep 17 00:00:00 2001 From: nobu Date: Sat, 28 Feb 2015 06:44:22 +0000 Subject: vm_dump.c: no new strings in signal context * vm_dump.c (rb_vm_bugreport): get rid of making new strings inside signal context. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@49780 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- vm_dump.c | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) (limited to 'vm_dump.c') diff --git a/vm_dump.c b/vm_dump.c index da2e6a951d..a0d8bcb4d1 100644 --- a/vm_dump.c +++ b/vm_dump.c @@ -1000,12 +1000,21 @@ rb_vm_bugreport(const void *ctx) else if (RB_TYPE_P(name, T_CLASS) || RB_TYPE_P(name, T_MODULE)) { const char *const type = RB_TYPE_P(name, T_CLASS) ? "class" : "module"; - name = rb_class_name(name); + name = rb_search_class_path(rb_class_real(name)); + if (!RB_TYPE_P(name, T_STRING)) { + fprintf(stderr, " %4d %s:\n", i, type); + continue; + } fprintf(stderr, " %4d %s:%.*s\n", i, type, LIMITED_NAME_LENGTH(name), RSTRING_PTR(name)); } else { - VALUE klass = rb_class_name(CLASS_OF(name)); + VALUE klass = rb_search_class_path(rb_obj_class(name)); + if (!RB_TYPE_P(klass, T_STRING)) { + fprintf(stderr, " %4d #<%p:%p>\n", i, + (void *)CLASS_OF(name), (void *)name); + continue; + } fprintf(stderr, " %4d #<%.*s:%p>\n", i, LIMITED_NAME_LENGTH(klass), RSTRING_PTR(klass), (void *)name); -- cgit v1.2.3