summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThorsten Kukuk <kukuk@thkukuk.de>2017-03-21 16:47:00 +0100
committerThorsten Kukuk <kukuk@thkukuk.de>2017-03-21 16:47:00 +0100
commit261d0141b3b563b9105ab2aaeda9fa15a4990da5 (patch)
tree57b762888103bdb66237180eec2f15b62e143abf
parent1e4d83f6fe38613e6f209ff09dfad8e69a6e1629 (diff)
parente4e26210c3bdb5dcdce7a3def3b90fa45d3e2c89 (diff)
downloadglibc-261d0141b3b563b9105ab2aaeda9fa15a4990da5.tar.gz
Merge branch 'master' of ssh://sourceware.org/git/glibc
Conflicts: ChangeLog
-rw-r--r--ChangeLog5
-rw-r--r--malloc/tst-interpose-aux.c2
2 files changed, 6 insertions, 1 deletions
diff --git a/ChangeLog b/ChangeLog
index f500b833de..c292a5bf29 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -47,6 +47,11 @@
* nis/nis_subr.c: Likewise.
* nis/nis_verifygroup.c: Likewise.
+2017-03-21 Stefan Liebler <stli@linux.vnet.ibm.com>
+
+ * malloc/tst-interpose-aux.c (check_for_allocations):
+ Move compiler barrier before free.
+
2017-03-20 Joseph Myers <joseph@codesourcery.com>
[BZ #21279]
diff --git a/malloc/tst-interpose-aux.c b/malloc/tst-interpose-aux.c
index e80e979299..68282b41d5 100644
--- a/malloc/tst-interpose-aux.c
+++ b/malloc/tst-interpose-aux.c
@@ -113,11 +113,11 @@ check_for_allocations (void)
{
/* Make sure that malloc is called at least once from libc. */
void *volatile ptr = strdup ("ptr");
- free (ptr);
/* Compiler barrier. The strdup function calls malloc, which
updates allocation_index, but strdup is marked __THROW, so
the compiler could optimize away the reload. */
__asm__ volatile ("" ::: "memory");
+ free (ptr);
/* If the allocation count is still zero, it means we did not
interpose malloc successfully. */
if (allocation_index == 0)