1
Fork 0

Fix backtrace tests for Linux

This commit is contained in:
Manish Goregaokar 2015-03-02 16:11:01 +05:30 committed by Felix S. Klock II
parent 4e23179c85
commit 185c074798
2 changed files with 5 additions and 5 deletions

View file

@ -176,7 +176,7 @@ pub fn write(w: &mut Writer) -> IoResult<()> {
let mut ip = unsafe {
uw::_Unwind_GetIPInfo(ctx, &mut ip_before_insn) as *mut libc::c_void
};
if ip_before_insn == 0 {
if !ip.is_null() && ip_before_insn == 0 {
// this is a non-signaling frame, so `ip` refers to the address
// after the calling instruction. account for that.
ip = (ip as usize - 1) as *mut _;