PR29262, memory leak in pr_function_type
[binutils-gdb.git] / gdb / ppc-sysv-tdep.c
index 86f0acb05438b964c4bee03ca6b3459bafcbbdc3..6c2fd1bfc99843b1cb297cb982125d545d88de26 100644 (file)
@@ -1,7 +1,7 @@
 /* Target-dependent code for PowerPC systems using the SVR4 ABI
    for GDB, the GNU debugger.
 
-   Copyright (C) 2000-2021 Free Software Foundation, Inc.
+   Copyright (C) 2000-2022 Free Software Foundation, Inc.
 
    This file is part of GDB.
 
@@ -1059,7 +1059,7 @@ convert_code_addr_to_desc_addr (CORE_ADDR code_addr, CORE_ADDR *desc_addr)
   if (fn.minsym == NULL)
     return 0;
   /* Found a descriptor.  */
-  (*desc_addr) = BMSYMBOL_VALUE_ADDRESS (fn);
+  (*desc_addr) = fn.value_address ();
   return 1;
 }
 
@@ -1761,7 +1761,8 @@ ppc64_sysv_abi_return_value_base (struct gdbarch *gdbarch, struct type *valtype,
              /* Fixed point type values need to be returned unscaled.  */
              gdb_mpz unscaled;
 
-             unscaled.read ({writebuf, TYPE_LENGTH (valtype)},
+             unscaled.read (gdb::make_array_view (writebuf,
+                                                  TYPE_LENGTH (valtype)),
                             type_byte_order (valtype),
                             valtype->is_unsigned ());
              return_val = unscaled.as_integer<LONGEST> ();