2012-10-26 Pedro Alves <palves@redhat.com>

* amd64-tdep.c (amd64_relocate_instruction): Use
	store_unsigned_integer instead of memcpy.
	* i386-tdep.c (i386_relocate_instruction): Ditto.
This commit is contained in:
Pedro Alves
2012-10-26 19:34:09 +00:00
parent 940c3c0683
commit 144db8270d
3 changed files with 8 additions and 2 deletions

View File

@ -1631,7 +1631,7 @@ amd64_relocate_instruction (struct gdbarch *gdbarch,
/* Where "ret" in the original code will return to. */
ret_addr = oldloc + insn_length;
push_buf[0] = 0x68; /* pushq $... */
memcpy (&push_buf[1], &ret_addr, 4);
store_unsigned_integer (&push_buf[1], 4, byte_order, ret_addr);
/* Push the push. */
append_insns (to, 5, push_buf);