aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--gdb/frame-info.h6
1 files changed, 5 insertions, 1 deletions
diff --git a/gdb/frame-info.h b/gdb/frame-info.h
index 3369b11..893b663 100644
--- a/gdb/frame-info.h
+++ b/gdb/frame-info.h
@@ -76,7 +76,11 @@ public:
~frame_info_ptr ()
{
- frame_list.erase (frame_list.iterator_to (*this));
+ /* If this node has static storage, it may be deleted after
+ frame_list. Attempting to erase ourselves would then trigger
+ internal errors, so make sure we are still linked first. */
+ if (is_linked ())
+ frame_list.erase (frame_list.iterator_to (*this));
}
frame_info_ptr &operator= (const frame_info_ptr &other)