diff options
author | ian <ian@138bc75d-0d04-0410-961f-82ee72b054a4> | 2010-01-26 04:05:32 +0000 |
---|---|---|
committer | ian <ian@138bc75d-0d04-0410-961f-82ee72b054a4> | 2010-01-26 04:05:32 +0000 |
commit | 9734aa00d4e39f06b24630aeca903ca621c37ab2 (patch) | |
tree | acf80aac712595d9af66c48e19f3415b96e24e07 /libiberty | |
parent | 8dca6d9da519b922b9f22c24f06519cd7aaed601 (diff) | |
download | gcc-9734aa00d4e39f06b24630aeca903ca621c37ab2.tar.gz |
* cp-demangle.c (cplus_demangle_type): Check for invalid type
after "DF".
* testsuite/demangle-expected: Add test.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@156226 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libiberty')
-rw-r--r-- | libiberty/ChangeLog | 8 | ||||
-rw-r--r-- | libiberty/cp-demangle.c | 4 | ||||
-rw-r--r-- | libiberty/testsuite/demangle-expected | 7 |
3 files changed, 15 insertions, 4 deletions
diff --git a/libiberty/ChangeLog b/libiberty/ChangeLog index 1e2fbffdf74..fcbef269c87 100644 --- a/libiberty/ChangeLog +++ b/libiberty/ChangeLog @@ -1,3 +1,9 @@ +2010-01-25 Ian Lance Taylor <iant@google.com> + + * cp-demangle.c (cplus_demangle_type): Check for invalid type + after "DF". + * testsuite/demangle-expected: Add test. + 2010-01-20 Jason Merrill <jason@redhat.com> PR c++/42338 @@ -294,7 +300,7 @@ with other than 1 operand. (d_print_comp): Handle function parameters. Fix bug with function used in type of function. - * testsuite/demangle-expected: Upate tests. + * testsuite/demangle-expected: Update tests. 2009-02-21 Mark Mitchell <mark@codesourcery.com> diff --git a/libiberty/cp-demangle.c b/libiberty/cp-demangle.c index f28e1636921..2f4d0cc9a30 100644 --- a/libiberty/cp-demangle.c +++ b/libiberty/cp-demangle.c @@ -1,5 +1,5 @@ /* Demangler for g++ V3 ABI. - Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008 + Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 Free Software Foundation, Inc. Written by Ian Lance Taylor <ian@wasabisystems.com>. @@ -2193,6 +2193,8 @@ cplus_demangle_type (struct d_info *di) /* For demangling we don't care about the bits. */ d_number (di); ret->u.s_fixed.length = cplus_demangle_type (di); + if (ret->u.s_fixed.length == NULL) + return NULL; d_number (di); peek = d_next_char (di); ret->u.s_fixed.sat = (peek == 's'); diff --git a/libiberty/testsuite/demangle-expected b/libiberty/testsuite/demangle-expected index c201a983271..eaa7ca9c9e5 100644 --- a/libiberty/testsuite/demangle-expected +++ b/libiberty/testsuite/demangle-expected @@ -4019,5 +4019,8 @@ prot.lock.update --format=gnat prot__lock__update_E6s prot.lock.update - - +# +# Used to crash the demangler. +--format=gnu-v3 +DFA +DFA |