aboutsummaryrefslogtreecommitdiff
path: root/sim/m32r
diff options
context:
space:
mode:
authorTsukasa OI <research_trasio@irq.a4lg.com>2022-09-26 07:03:00 +0000
committerTsukasa OI <research_trasio@irq.a4lg.com>2022-10-29 08:13:15 +0000
commit45f8296e6965ff4e2ca855e995149add6352645d (patch)
tree320e55a613d4e472983d91cd1b4a204efcd8cb27 /sim/m32r
parent57e3eee069a54ca09d89055bf6eccff710f87ed8 (diff)
downloadgdb-45f8296e6965ff4e2ca855e995149add6352645d.zip
gdb-45f8296e6965ff4e2ca855e995149add6352645d.tar.gz
gdb-45f8296e6965ff4e2ca855e995149add6352645d.tar.bz2
sim/m32r: Initialize "list" variable
The variable "list" is only initialized when arg1 > 0 and when arg1 == 0, an uninitialized value is passed to translate_endian_h2t function. Although this behavior is harmless, this commit adds initialization to avoid a GCC warning ("-Wmaybe-uninitialized").
Diffstat (limited to 'sim/m32r')
-rw-r--r--sim/m32r/traps.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/sim/m32r/traps.c b/sim/m32r/traps.c
index 267d548..12a87b4 100644
--- a/sim/m32r/traps.c
+++ b/sim/m32r/traps.c
@@ -547,7 +547,7 @@ m32r_trap (SIM_CPU *current_cpu, PCADDR pc, int num)
case TARGET_LINUX_SYS_getgroups32:
case TARGET_LINUX_SYS_getgroups:
{
- gid_t *list;
+ gid_t *list = NULL;
if (arg1 > 0)
list = (gid_t *) malloc (arg1 * sizeof(gid_t));