diff options
author | Andrew Haley <aph@redhat.com> | 2005-12-15 16:17:50 +0000 |
---|---|---|
committer | Andrew Haley <aph@gcc.gnu.org> | 2005-12-15 16:17:50 +0000 |
commit | a8acd1c48099154ef824961457aa1aecfc10bbee (patch) | |
tree | 62476ed7ef0802aac9d0408455a2b653a246a9f7 /gcc/unwind-dw2-fde-glibc.c | |
parent | 6c9ac67a41fd7b4c4df8ac3ee28acd490a6cae37 (diff) | |
download | gcc-a8acd1c48099154ef824961457aa1aecfc10bbee.tar.gz |
unwind-dw2-fde-glibc.c (_Unwind_IteratePhdrCallback): Guard against prev_cache_entry == NULL when moving a cache entry to the head of...
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.
From-SVN: r108582
Diffstat (limited to 'gcc/unwind-dw2-fde-glibc.c')
-rw-r--r-- | gcc/unwind-dw2-fde-glibc.c | 5 |
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; |