This is the mail archive of the
gdb-patches@sources.redhat.com
mailing list for the GDB project.
Re: [commited] small changes to fix hpux-cc compile
- From: mec dot gnu at mindspring dot com (Michael Elizabeth Chastain)
- To: randolph at tausq dot org
- Cc: gdb-patches at sources dot redhat dot com
- Date: Sun, 16 May 2004 11:55:32 -0400 (EDT)
- Subject: Re: [commited] small changes to fix hpux-cc compile
> Yes, this was indeed my thinking and why i hardcoded it.
So what happens if your hardcoded auto array of size 4 ever overflows?
We get a nasty bit of stack corruption. I hate seeing code like this
creep into gdb. It works until something else changes and then it
quietly crashes or prints random bad results.
The reason this code stopped compiling is that TARGET_INT_BIT became
more dynamic; it changed from a manifest constant to a function call.
char dld_flags_buffer[4];
...
status = target_read_memory (addr, dld_flags_buffer, TARGET_INT_BIT / TARGET_CHAR_BIT);
That's just wrong!
Michael C