summaryrefslogtreecommitdiff
path: root/vm_backtrace.c
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2014-10-15 14:37:54 (GMT)
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2014-10-15 14:37:54 (GMT)
commit2a61ff2e6502426405c64177d51b5f315ac2ec1d (patch)
tree1f55a9e82a2aefb25b0fee54e73fa74479dd5b8d /vm_backtrace.c
parent2d1578804b769d00be6145ad335a90b7184e50bb (diff)
vm_backtrace.c: fix unknown ID name
* vm_backtrace.c (id2str): adapt rb_id2str which returns 0 on unknown ID to return Qnil, since oldbt_arg functions expect Qnil on unknown method names. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@47951 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'vm_backtrace.c')
-rw-r--r--vm_backtrace.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/vm_backtrace.c b/vm_backtrace.c
index d461f05..63b5fc3 100644
--- a/vm_backtrace.c
+++ b/vm_backtrace.c
@@ -23,6 +23,15 @@ static VALUE rb_cBacktraceLocation;
extern VALUE ruby_engine_name;
+static VALUE
+id2str(ID id)
+{
+ VALUE str = rb_id2str(id);
+ if (!id) return Qnil;
+ return str;
+}
+#define rb_id2str(id) id2str(id)
+
inline static int
calc_lineno(const rb_iseq_t *iseq, const VALUE *pc)
{