gdb: use assignment to initialize variable in tdesc_parse_xml
authorSimon Marchi <simon.marchi@polymtl.ca>
Fri, 3 Feb 2023 13:23:32 +0000 (08:23 -0500)
committerSimon Marchi <simon.marchi@polymtl.ca>
Fri, 3 Feb 2023 13:23:39 +0000 (08:23 -0500)
Since allocate_target_description returns a target_desc_up, use
assignment to initialize the description variable.

Change-Id: Iab3311642c09b95648984f305936f4a4cde09440

gdb/xml-tdesc.c

index ba7154c5d56f59356dbf96613cb0c2cb65a64cd9..a8b0b0566c72935739a80d53ff271607cb5d7af8 100644 (file)
@@ -638,7 +638,7 @@ tdesc_parse_xml (const char *document, xml_fetch_another fetcher)
     return it->second.get ();
 
   memset (&data, 0, sizeof (struct tdesc_parsing_data));
-  target_desc_up description (allocate_target_description ());
+  target_desc_up description = allocate_target_description ();
   data.tdesc = description.get ();
 
   if (gdb_xml_parse_quick (_("target description"), "gdb-target.dtd",