This is the mail archive of the
gdb@sourceware.org
mailing list for the GDB project.
dwarf2_evaluate_loc_desc() in dwarf2loc.c
- From: Carl Burch <cdb at cup dot hp dot com>
- To: gdb at sourceware dot org
- Date: Tue, 23 Jan 2007 16:05:23 -0800 (PST)
- Subject: dwarf2_evaluate_loc_desc() in dwarf2loc.c
I had a defect that wandered into dwarf2_evaluate_loc_desc() of
dwarf2loc.c, specificly the section (in the current FSF CVS top-of-trunk
version) :
if (size == 0)
{
retval = allocate_value (SYMBOL_TYPE (var));
VALUE_LVAL (retval) = not_lval;
set_value_optimized_out (retval, 1);
}
This then clause looks odd. If "size" actually is zero, then shouldn't
there be a "return retval;" to close that then block? If not, the
value allocated in that block leaks when "retval" is overwritten in
each case below that.
- Carl Burch
HP WDB Team