public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* More fixes from static analysis checkers
@ 2011-03-24 21:53 Jeff Law
  2011-03-24 22:11 ` Diego Novillo
  2011-05-25 18:55 ` Jakub Jelinek
  0 siblings, 2 replies; 3+ messages in thread
From: Jeff Law @ 2011-03-24 21:53 UTC (permalink / raw)
  To: gcc-patches

[-- Attachment #1: Type: text/plain, Size: 881 bytes --]

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1


We had a variety of functions which would fail to call va_end prior to
returning.  I'm not aware of a host were this could cause a problem, but
it's easy enough to fix and keeps the checkers quiet.

Bootstrapped and regression tested on x86_64-unknown-linux-gnu.  OK for
trunk?


-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.11 (GNU/Linux)
Comment: Using GnuPG with Fedora - http://enigmail.mozdev.org/

iQEcBAEBAgAGBQJNi705AAoJEBRtltQi2kC7i7wIALDzCORDo9tes44r+2TwMiPZ
u3i6nY3Xe6q2wq9pZB9xlsw7kMPlul+0iaC2vcTMNIDmb/xhYvAZmhi2QYOWtvBb
QV3MB1ZLaWIEKDR9r6H0lu5MnRCEt5XGDRheyQPsMoZncmBMiO/IPxs++/P5eH3l
KMue8z2aC2++mYiPkyLb3rUVMTVlwjFXVI58M1BeaxTPYNpqyuIyYK4WZ/+X18fV
yZqn6ogCXiJRCgv8NZ4Nk98wgtLH42aYNnc7zVRA9wKOPorXxB6yMkLV60mWCUtp
4u3Fkw3Ri2TQ3y+fzbjD0N7j6f21bE2KVYqsmxS/bHO9YyskLUKxIVOSiAxE8Tg=
=Jc83
-----END PGP SIGNATURE-----

[-- Attachment #2: patch --]
[-- Type: text/plain, Size: 2385 bytes --]

	* dwarf2asm.c (dw2_asm_output_encoded_addr_rtx): Add missing
	va_end.
	* c-family/c-common.c (def_fn_type): Likewise.
	* ada/gcc-interface/utils.c (def_fn_type): Likewise.
	* emit-rtl.c (gen_rtvec): Likewise.
	* lto/lto-lang.c (def_fn_type): Likewise.

Index: dwarf2asm.c
===================================================================
*** dwarf2asm.c	(revision 171351)
--- dwarf2asm.c	(working copy)
*************** dw2_asm_output_encoded_addr_rtx (int enc
*** 957,962 ****
--- 957,963 ----
      {
        assemble_align (POINTER_SIZE);
        assemble_integer (addr, size, POINTER_SIZE, 1);
+       va_end (ap);
        return;
      }
  
Index: c-family/c-common.c
===================================================================
*** c-family/c-common.c	(revision 171351)
--- c-family/c-common.c	(working copy)
*************** def_fn_type (builtin_type def, builtin_t
*** 4428,4433 ****
--- 4428,4434 ----
  
   egress:
    builtin_types[def] = t;
+   va_end (list);
  }
  
  /* Build builtin functions common to both C and C++ language
Index: ada/gcc-interface/utils.c
===================================================================
*** ada/gcc-interface/utils.c	(revision 171351)
--- ada/gcc-interface/utils.c	(working copy)
*************** def_fn_type (builtin_type def, builtin_t
*** 4930,4935 ****
--- 4930,4936 ----
  
   egress:
    builtin_types[def] = t;
+   va_end (list);
  }
  
  /* Build the builtin function types and install them in the builtin_types
Index: emit-rtl.c
===================================================================
*** emit-rtl.c	(revision 171351)
--- emit-rtl.c	(working copy)
*************** gen_rtvec (int n, ...)
*** 805,811 ****
  
    /* Don't allocate an empty rtvec...  */
    if (n == 0)
!     return NULL_RTVEC;
  
    rt_val = rtvec_alloc (n);
  
--- 805,814 ----
  
    /* Don't allocate an empty rtvec...  */
    if (n == 0)
!     {
!       va_end (p);
!       return NULL_RTVEC;
!     }
  
    rt_val = rtvec_alloc (n);
  
Index: lto/lto-lang.c
===================================================================
*** lto/lto-lang.c	(revision 171351)
--- lto/lto-lang.c	(working copy)
*************** def_fn_type (builtin_type def, builtin_t
*** 471,476 ****
--- 471,477 ----
  
   egress:
    builtin_types[def] = t;
+   va_end (list);
  }
  
  /* Used to help initialize the builtin-types.def table.  When a type of

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: More fixes from static analysis checkers
  2011-03-24 21:53 More fixes from static analysis checkers Jeff Law
@ 2011-03-24 22:11 ` Diego Novillo
  2011-05-25 18:55 ` Jakub Jelinek
  1 sibling, 0 replies; 3+ messages in thread
From: Diego Novillo @ 2011-03-24 22:11 UTC (permalink / raw)
  To: Jeff Law; +Cc: gcc-patches

On Thu, Mar 24, 2011 at 17:52, Jeff Law <law@redhat.com> wrote:

> Bootstrapped and regression tested on x86_64-unknown-linux-gnu.  OK for
> trunk?

OK.


Diego.

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: More fixes from static analysis checkers
  2011-03-24 21:53 More fixes from static analysis checkers Jeff Law
  2011-03-24 22:11 ` Diego Novillo
@ 2011-05-25 18:55 ` Jakub Jelinek
  1 sibling, 0 replies; 3+ messages in thread
From: Jakub Jelinek @ 2011-05-25 18:55 UTC (permalink / raw)
  To: Jeff Law; +Cc: gcc-patches

On Thu, Mar 24, 2011 at 03:52:57PM -0600, Jeff Law wrote:
> We had a variety of functions which would fail to call va_end prior to
> returning.  I'm not aware of a host were this could cause a problem, but
> it's easy enough to fix and keeps the checkers quiet.

In case of def_fn_type, this added a second va_end if the function
doesn't fail.
This patch removes the first va_end, bootstrapped/regtested on x86_64-linux
and i686-linux, committed as obvious.

2011-05-25  Jakub Jelinek  <jakub@redhat.com>

	* c-common.c (def_fn_type): Remove extra va_end.

	* gcc-interface/utils.c (def_fn_type): Remove extra va_end.

--- gcc/c-family/c-common.c.jj	2011-05-24 23:34:16.000000000 +0200
+++ gcc/c-family/c-common.c	2011-05-25 16:50:57.000000000 +0200
@@ -4451,7 +4451,6 @@ def_fn_type (builtin_type def, builtin_t
 	goto egress;
       args[i] = t;
     }
-  va_end (list);
 
   t = builtin_types[ret];
   if (t == error_mark_node)
--- gcc/ada/gcc-interface/utils.c.jj	2011-05-11 19:38:55.000000000 +0200
+++ gcc/ada/gcc-interface/utils.c	2011-05-25 16:52:00.000000000 +0200
@@ -4965,7 +4965,6 @@ def_fn_type (builtin_type def, builtin_t
 	goto egress;
       args[i] = t;
     }
-  va_end (list);
 
   t = builtin_types[ret];
   if (t == error_mark_node)


	Jakub

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2011-05-25 17:28 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-03-24 21:53 More fixes from static analysis checkers Jeff Law
2011-03-24 22:11 ` Diego Novillo
2011-05-25 18:55 ` Jakub Jelinek

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).