From 0c0f75b7983e6083ad21690149bf79ea878c6804 Mon Sep 17 00:00:00 2001 From: naruse Date: Wed, 17 May 2017 07:13:47 +0000 Subject: [PATCH] Treat NULL reference case [Bug #13566] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58769 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- vm_dump.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/vm_dump.c b/vm_dump.c index d423f1a5a4..f249b7efec 100644 --- a/vm_dump.c +++ b/vm_dump.c @@ -475,8 +475,8 @@ darwin_sigtramp: unw_set_reg(&cursor, UNW_X86_64_R14, uctx->uc_mcontext->__ss.__r14); unw_set_reg(&cursor, UNW_X86_64_R15, uctx->uc_mcontext->__ss.__r15); ip = uctx->uc_mcontext->__ss.__rip; - if (((char*)ip)[-2] == 0x0f && ((char*)ip)[-1] == 5) { - /* signal received in syscall */ + if (!ip || (((char*)ip)[-2] == 0x0f && ((char*)ip)[-1] == 5)) { + /* NULL reference or signal received in syscall */ trace[n++] = (void *)ip; ip = *(unw_word_t*)uctx->uc_mcontext->__ss.__rsp; }