summaryrefslogtreecommitdiff
path: root/vm_dump.c
diff options
context:
space:
mode:
authornaruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2017-05-17 07:13:47 +0000
committernaruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2017-05-17 07:13:47 +0000
commit0c0f75b7983e6083ad21690149bf79ea878c6804 (patch)
tree16076c580b46a40a116a38ac6db05f6cf06311b0 /vm_dump.c
parent9cf7985893f33ba6f93b5b657c73e0ca289610cd (diff)
downloadruby-0c0f75b7983e6083ad21690149bf79ea878c6804.tar.gz
Treat NULL reference case [Bug #13566]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58769 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'vm_dump.c')
-rw-r--r--vm_dump.c4
1 files 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;
}