* sparc-tdep.c (sparc_fetch_instruction): Return zero if we can't

read the instruction at PC.
This commit is contained in:
Mark Kettenis
2004-01-24 21:34:45 +00:00
parent 7e5e9f880f
commit 690668cc17
2 changed files with 6 additions and 1 deletions

View File

@ -96,7 +96,9 @@ sparc_fetch_instruction (CORE_ADDR pc)
unsigned long insn;
int i;
read_memory (pc, buf, sizeof (buf));
/* If we can't read the instruction at PC, return zero. */
if (target_read_memory (pc, buf, sizeof (buf)))
return 0;
insn = 0;
for (i = 0; i < sizeof (buf); i++)