[gdb/symtab] Replace TYPE_ALLOC + memset with TYPE_ZALLOC
authorTom de Vries <tdevries@suse.de>
Thu, 31 Aug 2023 07:37:44 +0000 (09:37 +0200)
committerTom de Vries <tdevries@suse.de>
Thu, 31 Aug 2023 07:37:44 +0000 (09:37 +0200)
I noticed a case of TYPE_ALLOC followed by memset.

Replace this with TYPE_ZALLOC.

Tested on x86_64-linux.

Approved-By: Tom Tromey <tom@tromey.com>
gdb/stabsread.c

index ad9258a9f203559aa91ec8d25b42634827b26cb0..18fefd6929c678125d4491139ca90e2eed0857bc 100644 (file)
@@ -2693,9 +2693,7 @@ read_member_functions (struct stab_field_info *fip, const char **pp,
     {
       ALLOCATE_CPLUS_STRUCT_TYPE (type);
       TYPE_FN_FIELDLISTS (type) = (struct fn_fieldlist *)
-       TYPE_ALLOC (type, sizeof (struct fn_fieldlist) * nfn_fields);
-      memset (TYPE_FN_FIELDLISTS (type), 0,
-             sizeof (struct fn_fieldlist) * nfn_fields);
+       TYPE_ZALLOC (type, sizeof (struct fn_fieldlist) * nfn_fields);
       TYPE_NFN_FIELDS (type) = nfn_fields;
     }