This is the mail archive of the
glibc-cvs@sourceware.org
mailing list for the glibc project.
GNU C Library master sources branch master updated. glibc-2.21-409-g1827059
- From: cmetcalf at sourceware dot org
- To: glibc-cvs at sourceware dot org
- Date: 27 May 2015 00:32:19 -0000
- Subject: GNU C Library master sources branch master updated. glibc-2.21-409-g1827059
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "GNU C Library master sources".
The branch, master has been updated
via 1827059925140a1f0c16faf23ee895ee72f84efc (commit)
from 4da82229f0ea9dd50e43f15705ee92d5d30c4158 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
http://sourceware.org/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=1827059925140a1f0c16faf23ee895ee72f84efc
commit 1827059925140a1f0c16faf23ee895ee72f84efc
Author: Chris Metcalf <cmetcalf@ezchip.com>
Date: Tue May 26 20:29:56 2015 -0400
tile: use better variable naming in INLINE_SYSCALL
At issue for INLINE_SYSCALL was that it used "err" and "val"
as variable names in a #define, so that if it was used in a context
where the "caller" was also using "err" or "val", and those
variables were passed in to INLINE_SYSCALL, we would end up
referencing the internal shadowed variables instead.
For example, "char val" in check_may_shrink_heap() in
sysdeps/unix/sysv/linux/malloc-sysdep.h was being shadowed by
the syscall return "val" in INLINE_SYSCALL, causing the "char val"
not to get updated at all, and may_shrink_heap ended up always false.
A similar fix was made to INTERNAL_VSYSCALL_CALL.
diff --git a/ChangeLog b/ChangeLog
index 7fcd403..4a38a05 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2015-05-26 Chris Metcalf <cmetcalf@ezchip.com>
+
+ * sysdeps/unix/sysv/linux/tile/sysdep.h (INLINE_SYSCALL):
+ Avoid using variables in #defines that might cause shadowing.
+ (INTERNAL_VSYSCALL_CALL): Likewise.
+
2015-05-26 Roland McGrath <roland@hack.frob.com>
* sysdeps/nacl/lll_timedlock_wait.c: New file.
diff --git a/sysdeps/unix/sysv/linux/tile/sysdep.h b/sysdeps/unix/sysv/linux/tile/sysdep.h
index 1f4122c..6b30b2f 100644
--- a/sysdeps/unix/sysv/linux/tile/sysdep.h
+++ b/sysdeps/unix/sysv/linux/tile/sysdep.h
@@ -78,16 +78,17 @@
/* Define a macro which expands inline into the wrapper code for a system
call. */
# undef INLINE_SYSCALL
-# define INLINE_SYSCALL(name, nr, args...) \
+# define INLINE_SYSCALL(name, nr, args...) \
({ \
- INTERNAL_SYSCALL_DECL (err); \
- unsigned long val = INTERNAL_SYSCALL (name, err, nr, args); \
- if (__builtin_expect (INTERNAL_SYSCALL_ERROR_P (val, err), 0)) \
- { \
- __set_errno (INTERNAL_SYSCALL_ERRNO (val, err)); \
- val = -1; \
- } \
- (long) val; })
+ INTERNAL_SYSCALL_DECL (_sc_err); \
+ unsigned long _sc_val = INTERNAL_SYSCALL (name, _sc_err, nr, args); \
+ if (__builtin_expect (INTERNAL_SYSCALL_ERROR_P (_sc_val, _sc_err), 0)) \
+ { \
+ __set_errno (INTERNAL_SYSCALL_ERRNO (_sc_val, _sc_err)); \
+ _sc_val = -1; \
+ } \
+ (long) _sc_val; \
+ })
#undef INTERNAL_SYSCALL
#define INTERNAL_SYSCALL(name, err, nr, args...) \
@@ -203,11 +204,11 @@
"=R05" (_clobber_r5), "=R10" (_clobber_r10)
-#define INTERNAL_VSYSCALL_CALL(funcptr, err, nr, args...) \
- ({ \
- struct syscall_return_value rv = funcptr (args); \
- err = rv.error; \
- rv.value; \
+#define INTERNAL_VSYSCALL_CALL(funcptr, err, nr, args...) \
+ ({ \
+ struct syscall_return_value _sc_rv = funcptr (args); \
+ err = _sc_rv.error; \
+ _sc_rv.value; \
})
/* List of system calls which are supported as vsyscalls. */
-----------------------------------------------------------------------
Summary of changes:
ChangeLog | 6 ++++++
sysdeps/unix/sysv/linux/tile/sysdep.h | 29 +++++++++++++++--------------
2 files changed, 21 insertions(+), 14 deletions(-)
hooks/post-receive
--
GNU C Library master sources