[03/13,gdb/symtab] Handle nullptr parent in parent_map::set_parent
Checks
Context |
Check |
Description |
linaro-tcwg-bot/tcwg_gdb_build--master-arm |
success
|
Testing passed
|
linaro-tcwg-bot/tcwg_gdb_build--master-aarch64 |
success
|
Testing passed
|
linaro-tcwg-bot/tcwg_gdb_check--master-arm |
success
|
Testing passed
|
linaro-tcwg-bot/tcwg_gdb_check--master-aarch64 |
success
|
Testing passed
|
Commit Message
Set_parent uses m_die_range_map.set_empty, which doesn't allow
parent_entry == nullptr.
So it may be necessary to guard calls to set_parent with
"if (parent_entry != nullptr)".
Fix this by handling the parent_entry == nullptr case.
Tested on x86_64-linux.
---
gdb/dwarf2/cooked-index.h | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
@@ -253,7 +253,10 @@ class parent_map
void set_parent (CORE_ADDR start, CORE_ADDR end,
const cooked_index_entry *parent_entry)
{
- m_parent_map.set_empty (start, end, (void *)parent_entry);
+ /* Calling set_empty with nullptr is currently not allowed. Note that we
+ still check the desired effect. */
+ if (parent_entry != nullptr)
+ m_parent_map.set_empty (start, end, (void *)parent_entry);
/* Assert that set_parent has the desired effect. This is not trivial due
to how set_empty works. If the range already has been set before, it