]> git.ipfire.org Git - thirdparty/glibc.git/commitdiff
Don't macro-expand failed assertion expression [BZ #18604]
authorDavid Kastrup <dak@gnu.org>
Tue, 3 Nov 2015 22:08:54 +0000 (23:08 +0100)
committerFlorian Weimer <fweimer@redhat.com>
Tue, 3 Nov 2015 22:26:15 +0000 (23:26 +0100)
[BZ #18604]
* assert/assert.h (assert): Don't macro-expand failed assertion
expression in error message.
* malloc/malloc.c (assert): Likewise.

ChangeLog
assert/assert.h
malloc/malloc.c

index 0abea41af652c57355a834f0af56ae8a73465e2a..35922ef76b512154b8ef2dd2bdcafb7f663079d8 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2015-11-03  David Kastrup  <dak@gnu.org>
+
+       [BZ #18604]
+       * assert/assert.h (assert): Don't macro-expand failed assertion
+       expression in error message.
+       * malloc/malloc.c (assert): Likewise.
+
 2015-11-03  Joseph Myers  <joseph@codesourcery.com>
 
        * configure.ac (libc_cv_ld_no_whole_archive): Remove configure
index d04c58cc8a664ec1e568b358a2973395ea8e1192..40b9848c1575a33a107087cc533fb4f99cb07124 100644 (file)
@@ -85,7 +85,7 @@ __END_DECLS
 # define assert(expr)                                                  \
   ((expr)                                                              \
    ? __ASSERT_VOID_CAST (0)                                            \
-   : __assert_fail (__STRING(expr), __FILE__, __LINE__, __ASSERT_FUNCTION))
+   : __assert_fail (#expr, __FILE__, __LINE__, __ASSERT_FUNCTION))
 
 # ifdef        __USE_GNU
 #  define assert_perror(errnum)                                                \
index 35c8863a32110a515d863c24464baa96467fc2f0..839263efc508cd999c23a3a4beda1a03eedae27b 100644 (file)
 # define assert(expr) \
   ((expr)                                                                    \
    ? ((void) 0)                                                                      \
-   : __malloc_assert (__STRING (expr), __FILE__, __LINE__, __func__))
+   : __malloc_assert (#expr, __FILE__, __LINE__, __func__))
 
 extern const char *__progname;