gdb: protect some 'regcache_read_pc' calls
[deliverable/binutils-gdb.git] / opcodes / metag-dis.c
index f01dcbaef1de0f004e107936f718562a471ddf81..b1cf6331b5dc583f76a2d821543911d54ddf2c26 100644 (file)
@@ -3364,9 +3364,15 @@ print_insn_metag (bfd_vma pc, disassemble_info *outf)
   bfd_byte buf[4];
   unsigned int insn_word;
   size_t i;
-  outf->bytes_per_chunk = 4;
+  int status;
 
-  (*outf->read_memory_func) (pc & ~0x03, buf, 4, outf);
+  outf->bytes_per_chunk = 4;
+  status = (*outf->read_memory_func) (pc & ~0x03, buf, 4, outf);
+  if (status)
+    {
+      (*outf->memory_error_func) (status, pc, outf);
+      return -1;
+    }
   insn_word = bfd_getl32 (buf);
 
   for (i = 0; i < sizeof(metag_optab)/sizeof(metag_optab[0]); i++)
This page took 0.022982 seconds and 4 git commands to generate.