From: Ian Lance Taylor Date: Tue, 8 Sep 2015 13:49:19 +0000 (+0000) Subject: re PR other/67457 (segfault in libbacktrace) X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=981d281fedcd06b027314608d6ea6743f314d81f;p=gcc.git re PR other/67457 (segfault in libbacktrace) PR other/67457 * mmap.c (backtrace_alloc): Correct test for mmap failure. From-SVN: r227529 --- diff --git a/libbacktrace/ChangeLog b/libbacktrace/ChangeLog index f44a73d7cc0..92ec7a13c4a 100644 --- a/libbacktrace/ChangeLog +++ b/libbacktrace/ChangeLog @@ -1,3 +1,8 @@ +2015-09-08 Ian Lance Taylor + + PR other/67457 + * mmap.c (backtrace_alloc): Correct test for mmap failure. + 2015-08-31 Ulrich Weigand * configure.ac: For spu-*-* targets, set have_fcntl to no. diff --git a/libbacktrace/mmap.c b/libbacktrace/mmap.c index 1ecf1311911..47c564f13f8 100644 --- a/libbacktrace/mmap.c +++ b/libbacktrace/mmap.c @@ -139,7 +139,7 @@ backtrace_alloc (struct backtrace_state *state, asksize = (size + pagesize - 1) & ~ (pagesize - 1); page = mmap (NULL, asksize, PROT_READ | PROT_WRITE, MAP_PRIVATE | MAP_ANONYMOUS, -1, 0); - if (page == NULL) + if (page == MAP_FAILED) error_callback (data, "mmap", errno); else {