Backport upstream commit 54195469c18, fixing a build problem

This commit is contained in:
Kevin Buettner 2024-01-17 13:10:14 -07:00
parent a84ff66cf3
commit 46b67ac265
4 changed files with 47 additions and 0 deletions

View File

@ -196,3 +196,6 @@ Patch045: gdb-rhbz2250652-avoid-PyOS_ReadlineTState.patch
# Backport potential fix for RH BZ 2257562. # Backport potential fix for RH BZ 2257562.
Patch046: gdb-rhbz2257562-cp-namespace-null-ptr-check.patch Patch046: gdb-rhbz2257562-cp-namespace-null-ptr-check.patch
Patch047: gdb-ftbs-swapped-calloc-args.patch

View File

@ -44,3 +44,4 @@
%patch -p1 -P044 %patch -p1 -P044
%patch -p1 -P045 %patch -p1 -P045
%patch -p1 -P046 %patch -p1 -P046
%patch -p1 -P047

View File

@ -44,3 +44,4 @@ gdb-rhbz-2232086-generate-dwarf-5-index-consistently.patch
gdb-rhbz2250652-gdbpy_gil.patch gdb-rhbz2250652-gdbpy_gil.patch
gdb-rhbz2250652-avoid-PyOS_ReadlineTState.patch gdb-rhbz2250652-avoid-PyOS_ReadlineTState.patch
gdb-rhbz2257562-cp-namespace-null-ptr-check.patch gdb-rhbz2257562-cp-namespace-null-ptr-check.patch
gdb-ftbs-swapped-calloc-args.patch

View File

@ -0,0 +1,42 @@
From FEDORA_PATCHES Mon Sep 17 00:00:00 2001
From: Kevin Buettner <kevinb@redhat.com>
Date: Wed, 17 Jan 2024 12:53:53 -0700
Subject: gdb-ftbs-swapped-calloc-args.patch
Backport upstream commit 54195469c18ec9873cc5ba6907f768509473fa9b
which fixes a build problem in which arguments to calloc were swapped.
[opcodes] ARC + PPC: Fix -Walloc-size warnings
Recently, -Walloc-size warnings started to kick in. Fix these two
calloc() calls to match the intended usage pattern.
opcodes/ChangeLog:
* arc-dis.c (init_arc_disasm_info): Fix calloc() call.
* ppc-dis.c (powerpc_init_dialect): Ditto.
diff --git a/opcodes/arc-dis.c b/opcodes/arc-dis.c
--- a/opcodes/arc-dis.c
+++ b/opcodes/arc-dis.c
@@ -147,7 +147,7 @@ static bool
init_arc_disasm_info (struct disassemble_info *info)
{
struct arc_disassemble_info *arc_infop
- = calloc (sizeof (*arc_infop), 1);
+ = calloc (1, sizeof (*arc_infop));
if (arc_infop == NULL)
return false;
diff --git a/opcodes/ppc-dis.c b/opcodes/ppc-dis.c
--- a/opcodes/ppc-dis.c
+++ b/opcodes/ppc-dis.c
@@ -348,7 +348,7 @@ powerpc_init_dialect (struct disassemble_info *info)
{
ppc_cpu_t dialect = 0;
ppc_cpu_t sticky = 0;
- struct dis_private *priv = calloc (sizeof (*priv), 1);
+ struct dis_private *priv = calloc (1, sizeof (*priv));
if (priv == NULL)
return;