Skip to content

Commit

Permalink
Don't assume libunwind can always find a function pointer.
Browse files Browse the repository at this point in the history
  • Loading branch information
yuyichao committed Oct 6, 2017
1 parent 50766d7 commit 1c17c22
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/debuginfo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -746,7 +746,9 @@ static void get_function_name_and_base(const object::ObjectFile *object, bool in
if (needs_saddr) {
#if (defined(_OS_LINUX_) || defined(_OS_FREEBSD_)) && !defined(JL_DISABLE_LIBUNWIND)
unw_proc_info_t pip;
if (unw_get_proc_info_by_ip(unw_local_addr_space, pointer, &pip, NULL) == 0) {
// Seems that libunwind may return NULL IP depending on what info it finds...
if (unw_get_proc_info_by_ip(unw_local_addr_space, pointer,
&pip, NULL) == 0 && pip.start_ip) {
*saddr = (void*)pip.start_ip;
needs_saddr = false;
}
Expand Down

0 comments on commit 1c17c22

Please sign in to comment.