Patchwork (committed) gcc/diagnostic.c: Add missing va_end call

login
register
mail settings
Submitter Tobias Burnus
Date Nov. 12, 2012, 11:01 a.m.
Message ID <50A0D6F6.3020804@net-b.de>
Download mbox | patch
Permalink /patch/198360/
State New
Headers show

Comments

Tobias Burnus - Nov. 12, 2012, 11:01 a.m.
An minor obvious fix, found by Coverity.

Committed as Rev. 193428 after all-language-bootstrap/regtesting on 
x86-64-gnu-linux.

Tobias

Patch

Index: gcc/ChangeLog
===================================================================
--- gcc/ChangeLog	(Revision 193427)
+++ gcc/ChangeLog	(Arbeitskopie)
@@ -1,3 +1,8 @@ 
+2012-11-12  Tobias Burnus  <burnus@net-b.de>
+
+	* diagnostic.c (diagnostic_append_note): Also call va_end when
+	inhibit_notes_p.
+
 2012-11-12  Bin Cheng  <bin.cheng@arm.com>
 
 	* gcse.c (struct bb_data): Add new fields, old_pressure, live_in
Index: gcc/diagnostic.c
===================================================================
--- gcc/diagnostic.c	(Revision 193427)
+++ gcc/diagnostic.c	(Arbeitskopie)
@@ -833,7 +833,10 @@  diagnostic_append_note (diagnostic_context *contex
   va_start (ap, gmsgid);
   diagnostic_set_info (&diagnostic, gmsgid, &ap, location, DK_NOTE);
   if (context->inhibit_notes_p)
-    return;
+    {
+      va_end (ap);
+      return;
+    }
   pp_set_prefix (context->printer,
                  diagnostic_build_prefix (context, &diagnostic));
   pp_newline (context->printer);