[RFA:] [patch] Initialize disassemble_info member private_data indis-asm.h
Hans-Peter Nilsson
hp@bitrange.com
Sat Dec 16 19:46:00 GMT 2000
More information about the Binutils mailing list
Sat Dec 16 19:46:00 GMT 2000
- Previous message (by thread): x86-64 support for gas part I
- Next message (by thread): [RFA:] [patch] Initialize disassemble_info member private_data indis-asm.h
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
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
- Previous message (by thread): x86-64 support for gas part I
- Next message (by thread): [RFA:] [patch] Initialize disassemble_info member private_data indis-asm.h
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
More information about the Binutils mailing list