]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
analyzer: fix stray trailing "allocated here" text in events
authorDavid Malcolm <dmalcolm@redhat.com>
Fri, 7 Nov 2025 21:21:06 +0000 (16:21 -0500)
committerDavid Malcolm <dmalcolm@redhat.com>
Fri, 7 Nov 2025 21:21:06 +0000 (16:21 -0500)
Fix event text like this (seen in gcc.dg/analyzer/allocation-size-5.c):

   31 |   char arr[sizeof (int16_t)];
      |        ^~~
      |        |
      |        (1) allocated 2 bytes hereallocated here

gcc/analyzer/ChangeLog:
* checker-event.cc
(region_creation_event_allocation_size::print_desc): Fix missing
"else" leading to stray trailing "allocated here" text in events.

Signed-off-by: David Malcolm <dmalcolm@redhat.com>
gcc/analyzer/checker-event.cc

index 3e54c2a408c0b17bbc3ff802362730f8ed41f4c6..57e36d470e8088f1c8cee8a5b91579fa199a2e97 100644 (file)
@@ -361,7 +361,8 @@ region_creation_event_allocation_size::print_desc (pretty_printer &pp) const
                   "allocated %qE bytes here",
                   m_capacity);
     }
-  pp_printf (&pp, "allocated here");
+  else
+    pp_printf (&pp, "allocated here");
 }
 
 void