From e103e98648ab7db6fbfe62faf3533ac4ffda743b Mon Sep 17 00:00:00 2001 From: Jan Kratochvil Date: Thu, 13 Oct 2011 09:36:47 +0000 Subject: [PATCH] gdb/ * dwarf2read.c (dwarf2_fetch_die_location_block): Initialize .data even if .size is 0. --- gdb/ChangeLog | 5 +++++ gdb/dwarf2read.c | 4 +++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 479d7cef17e..e58ca8009d0 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,8 @@ +2011-10-13 Jan Kratochvil + + * dwarf2read.c (dwarf2_fetch_die_location_block): Initialize .data even + if .size is 0. + 2011-10-13 Yao Qi PR gdb/12703 diff --git a/gdb/dwarf2read.c b/gdb/dwarf2read.c index 5fa6c5b3870..99f67d9c8d9 100644 --- a/gdb/dwarf2read.c +++ b/gdb/dwarf2read.c @@ -14217,8 +14217,10 @@ dwarf2_fetch_die_location_block (unsigned int offset, attr = dwarf2_attr (die, DW_AT_location, cu); if (!attr) { - /* DWARF: "If there is no such attribute, then there is no effect.". */ + /* DWARF: "If there is no such attribute, then there is no effect.". + DATA is ignored if SIZE is 0. */ + retval.data = NULL; retval.size = 0; } else if (attr_form_is_section_offset (attr)) -- 2.30.2