From c98d82db4c7fa8d94bcf8759f8f9ed622cc9b77f Mon Sep 17 00:00:00 2001 From: Ulrich Drepper Date: Thu, 29 Aug 2002 10:42:30 +0000 Subject: Update. 2002-08-29 Jakub Jelinek * stdio-common/vfprintf.c (vfprintf): Add builtin_expect for string_malloced, it is unlikely to be set. Only call free with non-NULL workspace. * sysdeps/sparc/sparc32/sparcv9/Makefile (sysdep-CFLAGS): Use -mcpu=ultrasparc, not only tune for it. (ASFLAGS*): Set unconditionally. 2002-08-29 Jakub Jelinek * sysdeps/generic/readelflib.c (process_elf_file): Make loadaddr ElfW(Addr). Don't mask upper 32-bits and lower 12 bits off from p_vaddr/p_offset when computing loadaddr. --- stdio-common/vfprintf.c | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) (limited to 'stdio-common') diff --git a/stdio-common/vfprintf.c b/stdio-common/vfprintf.c index e59d6fbcd1..f181a0ae00 100644 --- a/stdio-common/vfprintf.c +++ b/stdio-common/vfprintf.c @@ -1084,7 +1084,7 @@ vfprintf (FILE *s, const CHAR_T *format, va_list ap) outstring (string, len); \ if (left) \ PAD (L' '); \ - if (string_malloced) \ + if (__builin_expect (string_malloced, 0)) \ free (string); \ } \ break; @@ -1255,7 +1255,7 @@ vfprintf (FILE *s, const CHAR_T *format, va_list ap) outstring (string, len); \ if (left) \ PAD (' '); \ - if (string_malloced) \ + if (__builtin_expect (string_malloced, 0)) \ free (string); \ } \ break; @@ -1595,7 +1595,8 @@ vfprintf (FILE *s, const CHAR_T *format, va_list ap) /* The format is correctly handled. */ ++nspecs_done; - free (workstart); + if (__builtin_expect (workstart != NULL, 0)) + free (workstart); workstart = NULL; /* Look for next format specifier. */ @@ -1893,7 +1894,8 @@ do_positional: break; } - free (workstart); + if (__builtin_expect (workstart != NULL, 0)) + free (workstart); workstart = NULL; /* Write the following constant string. */ @@ -1904,7 +1906,8 @@ do_positional: } all_done: - free (workstart); + if (__builtin_expect (workstart != NULL, 0)) + free (workstart); /* Unlock the stream. */ #ifdef USE_IN_LIBIO _IO_funlockfile (s); -- cgit v1.2.3