summaryrefslogtreecommitdiff
path: root/gcc/unwind-dw2-fde-glibc.c
diff options
context:
space:
mode:
authoraph <aph@138bc75d-0d04-0410-961f-82ee72b054a4>2005-12-15 16:17:50 +0000
committeraph <aph@138bc75d-0d04-0410-961f-82ee72b054a4>2005-12-15 16:17:50 +0000
commit8c1761def253d6964adf75c82546db507894e5cf (patch)
tree62476ed7ef0802aac9d0408455a2b653a246a9f7 /gcc/unwind-dw2-fde-glibc.c
parent5674bc5f7f2e9e93939537a2ecabbe533fd4abdc (diff)
downloadgcc-8c1761def253d6964adf75c82546db507894e5cf.tar.gz
2005-12-15 Andrew Haley <aph@redhat.com>
* unwind-dw2-fde-glibc.c (_Unwind_IteratePhdrCallback): Guard against prev_cache_entry == NULL when moving a cache entry to the head of the list. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@108582 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/unwind-dw2-fde-glibc.c')
-rw-r--r--gcc/unwind-dw2-fde-glibc.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/gcc/unwind-dw2-fde-glibc.c b/gcc/unwind-dw2-fde-glibc.c
index e7bd31b1583..25bf2bb1bce 100644
--- a/gcc/unwind-dw2-fde-glibc.c
+++ b/gcc/unwind-dw2-fde-glibc.c
@@ -257,7 +257,10 @@ _Unwind_IteratePhdrCallback (struct dl_phdr_info *info, size_t size, void *ptr)
if (size >= sizeof (struct ext_dl_phdr_info))
{
- if (last_cache_entry != NULL)
+ /* Move the cache entry we're about to overwrite to the head of
+ the list. If either last_cache_entry or prev_cache_entry are
+ NULL, that cache entry is already at the head. */
+ if (last_cache_entry != NULL && prev_cache_entry != NULL)
{
prev_cache_entry->link = last_cache_entry->link;
last_cache_entry->link = frame_hdr_cache_head;