do \
{ \
p += 2; \
- if (FETCH_DATA (info, p) < 0) \
+ if (!FETCH_DATA (info, p)) \
return -3; \
val = COERCE_SIGNED_CHAR (p[-1]); \
} \
do \
{ \
p += 2; \
- if (FETCH_DATA (info, p) < 0) \
+ if (!FETCH_DATA (info, p)) \
return ret_val; \
val = COERCE16 ((p[-2] << 8) + p[-1]); \
} \
do \
{ \
p += 4; \
- if (FETCH_DATA (info, p) < 0) \
+ if (!FETCH_DATA (info, p)) \
return ret_val; \
val = COERCE32 ((((((p[-4] << 8) + p[-3]) << 8) + p[-2]) << 8) + p[-1]); \
} \
do \
{ \
p += 4; \
- if (FETCH_DATA (info, p) < 0) \
+ if (!FETCH_DATA (info, p)) \
return -3; \
val = (unsigned int) ((((((p[-4] << 8) + p[-3]) << 8) + p[-2]) << 8) + p[-1]); \
} \
do \
{ \
p += 4; \
- if (FETCH_DATA (info, p) < 0) \
+ if (!FETCH_DATA (info, p)) \
return -3; \
floatformat_to_double (& floatformat_ieee_single_big, \
(char *) p - 4, & val); \
do \
{ \
p += 8; \
- if (FETCH_DATA (info, p) , 0) \
+ if (!FETCH_DATA (info, p)) \
return -3; \
floatformat_to_double (& floatformat_ieee_double_big, \
(char *) p - 8, & val); \
do \
{ \
p += 12; \
- if (FETCH_DATA (info, p) < 0) \
+ if (!FETCH_DATA (info, p)) \
return -3; \
floatformat_to_double (& floatformat_m68881_ext, \
(char *) p - 12, & val); \
do \
{ \
p += 12; \
- if (FETCH_DATA (info, p) < 0) \
+ if (!FETCH_DATA (info, p)) \
return -3; \
val = 0.0; \
} \
bfd_vma insn_start;
};
-static fprintf_ftype save_printer;
-static void (* save_print_address) (bfd_vma, struct disassemble_info *);
-
/* Make sure that bytes from INFO->PRIVATE_DATA->BUFFER (inclusive)
to ADDR (exclusive) are valid. Returns 1 for success, 0 on error. */
#define FETCH_DATA(info, addr) \
if (status != 0)
{
(*info->memory_error_func) (status, start, info);
- info->fprintf_func = save_printer;
- info->print_address_func = save_print_address;
return 0;
}
else
if (eaten >= 0)
p += eaten;
- else if (eaten == -1)
+ else if (eaten == -1 || eaten == -3)
{
info->fprintf_func = save_printer;
info->print_address_func = save_print_address;
return 0;
}
- else if (eaten == -3)
- return 0;
else
{
/* We must restore the print functions before trying to print the
int
print_insn_m68k (bfd_vma memaddr, disassemble_info *info)
{
- fprintf_ftype save_printer;
- void (* save_print_address) (bfd_vma, struct disassemble_info *);
unsigned int arch_mask;
struct private priv;
int val;
bfd_byte *buffer = priv.the_buffer;
- /* Save these printing functions in case we need to restore them
- later. */
- save_printer = info->fprintf_func;
- save_print_address = info->print_address_func;
-
info->private_data = & priv;
/* Tell objdump to use two bytes per chunk
and six bytes per line for displaying raw data. */
/* Handle undefined instructions. */
info->fprintf_func (info->stream, "0%o", (buffer[0] << 8) + buffer[1]);
- /* Restore print functions. */
- info->fprintf_func = save_printer;
- info->print_address_func = save_print_address;
-
return val ? val : 2;
}