about summary refs log tree commit diff
path: root/src/libstd/sys
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2015-03-03 14:18:03 +0000
committerbors <bors@rust-lang.org>2015-03-03 14:18:03 +0000
commit14f0942a49b77f81d0bedb3d8b5fb615ef521bb3 (patch)
treefa3cabf0f4e563a1b4f9e40fafa4855e905fd8e7 /src/libstd/sys
parent38e97b99a6b133cb4c621c68e75b28abc6c617c1 (diff)
parent243c5164ea32b38c4ac44fdd5e0ceb2da45c283f (diff)
downloadrust-14f0942a49b77f81d0bedb3d8b5fb615ef521bb3.tar.gz
rust-14f0942a49b77f81d0bedb3d8b5fb615ef521bb3.zip
Auto merge of #22532 - pnkfelix:arith-overflow, r=pnkfelix,eddyb
Rebase and follow-through on work done by @cmr and @aatch.

Implements most of rust-lang/rfcs#560. Errors encountered from the checks during building were fixed.

The checks for division, remainder and bit-shifting have not been implemented yet.

See also PR #20795

cc @Aatch ; cc @nikomatsakis
Diffstat (limited to 'src/libstd/sys')
-rw-r--r--src/libstd/sys/unix/backtrace.rs2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/libstd/sys/unix/backtrace.rs b/src/libstd/sys/unix/backtrace.rs
index d78cfd0ca37..e7ac6e2cd01 100644
--- a/src/libstd/sys/unix/backtrace.rs
+++ b/src/libstd/sys/unix/backtrace.rs
@@ -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 _;