Merge branch 'master' of ssh://sourceware.org/git/glibc

Conflicts:
	ChangeLog
This commit is contained in:
Thorsten Kukuk 2017-03-21 16:47:00 +01:00
commit 261d0141b3
2 changed files with 6 additions and 1 deletions

View File

@ -47,6 +47,11 @@
* nis/nis_subr.c: Likewise. * nis/nis_subr.c: Likewise.
* nis/nis_verifygroup.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> 2017-03-20 Joseph Myers <joseph@codesourcery.com>
[BZ #21279] [BZ #21279]

View File

@ -113,11 +113,11 @@ check_for_allocations (void)
{ {
/* Make sure that malloc is called at least once from libc. */ /* Make sure that malloc is called at least once from libc. */
void *volatile ptr = strdup ("ptr"); void *volatile ptr = strdup ("ptr");
free (ptr);
/* Compiler barrier. The strdup function calls malloc, which /* Compiler barrier. The strdup function calls malloc, which
updates allocation_index, but strdup is marked __THROW, so updates allocation_index, but strdup is marked __THROW, so
the compiler could optimize away the reload. */ the compiler could optimize away the reload. */
__asm__ volatile ("" ::: "memory"); __asm__ volatile ("" ::: "memory");
free (ptr);
/* If the allocation count is still zero, it means we did not /* If the allocation count is still zero, it means we did not
interpose malloc successfully. */ interpose malloc successfully. */
if (allocation_index == 0) if (allocation_index == 0)