This is the mail archive of the binutils@sources.redhat.com mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

[RFA:] [patch] Initialize disassemble_info member private_data indis-asm.h


Not initializing the private_data member in the initializer
macros seems like an oversight.

A disassemble-function has no way of knowing whether this is
initialized or not, in case it needs to initialize this member
and have it contain useful information that should live until the
next call, but not be re-initialized unnecessarily (like when
using dynamically allocated memory).  Well perhaps it could
(ab)use the insn_info_valid member, but a caller seems free to
clobber this as it feels like it.  See description of insn_info_valid
in dis-asm.h and a clobber in objdump.c:disassemble_bytes.

Ok to commit?

	* dis-asm.h (INIT_DISASSEMBLE_INFO_NO_ARCH): Initialize
	private_data member.

Index: dis-asm.h
===================================================================
RCS file: /cvs/src/src/include/dis-asm.h,v
retrieving revision 1.18
diff -p -c -r1.18 dis-asm.h
*** dis-asm.h	2000/09/29 18:07:47	1.18
--- dis-asm.h	2000/12/17 03:18:03
*************** extern int generic_symbol_at_address
*** 258,263 ****
--- 258,264 ----
    (INFO).stream = (PTR)(STREAM), \
    (INFO).symbols = NULL, \
    (INFO).num_symbols = 0, \
+   (INFO).private_data = NULL, \
    (INFO).buffer = NULL, \
    (INFO).buffer_vma = 0, \
    (INFO).buffer_length = 0, \

brgds, H-P


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]