aboutsummaryrefslogtreecommitdiff
path: root/gdb/gdbserver/spu-low.c
diff options
context:
space:
mode:
authorPedro Alves <palves@redhat.com>2012-04-05 11:20:50 +0000
committerPedro Alves <palves@redhat.com>2012-04-05 11:20:50 +0000
commit9d236627e73355de18e401a8dbaeb99997a2478b (patch)
treebf086c7baa219136c6f41cabeefaad6840e3dd2a /gdb/gdbserver/spu-low.c
parent443507505d3a8bac2b5dc2e8578af2006f68cc80 (diff)
downloadgdb-9d236627e73355de18e401a8dbaeb99997a2478b.zip
gdb-9d236627e73355de18e401a8dbaeb99997a2478b.tar.gz
gdb-9d236627e73355de18e401a8dbaeb99997a2478b.tar.bz2
2012-04-05 Pedro Alves <palves@redhat.com>
-Werror=strict-aliasing * spu-low.c (parse_spufs_run): Avoid dereferencing type-punned pointer.
Diffstat (limited to 'gdb/gdbserver/spu-low.c')
-rw-r--r--gdb/gdbserver/spu-low.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/gdb/gdbserver/spu-low.c b/gdb/gdbserver/spu-low.c
index 2a720ae..1ecd60c 100644
--- a/gdb/gdbserver/spu-low.c
+++ b/gdb/gdbserver/spu-low.c
@@ -206,14 +206,14 @@ store_ppc_memory (CORE_ADDR memaddr, char *myaddr, int len)
static int
parse_spufs_run (int *fd, CORE_ADDR *addr)
{
- char buf[4];
+ unsigned int insn;
CORE_ADDR pc = fetch_ppc_register (32); /* nip */
/* Fetch instruction preceding current NIP. */
- if (fetch_ppc_memory (pc-4, buf, 4) != 0)
+ if (fetch_ppc_memory (pc-4, (char *) &insn, 4) != 0)
return 0;
/* It should be a "sc" instruction. */
- if (*(unsigned int *)buf != INSTR_SC)
+ if (insn != INSTR_SC)
return 0;
/* System call number should be NR_spu_run. */
if (fetch_ppc_register (0) != NR_spu_run)