cp-demangle.c (cplus_demangle_type): Check for invalid type after "DF".

* cp-demangle.c (cplus_demangle_type): Check for invalid type
	after "DF".
	* testsuite/demangle-expected: Add test.

From-SVN: r156226
This commit is contained in:
Ian Lance Taylor 2010-01-26 04:05:32 +00:00
parent 77f02d096a
commit 79b754d47f
3 changed files with 15 additions and 4 deletions

View File

@ -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> 2010-01-20 Jason Merrill <jason@redhat.com>
PR c++/42338 PR c++/42338
@ -294,7 +300,7 @@
with other than 1 operand. with other than 1 operand.
(d_print_comp): Handle function parameters. Fix bug with (d_print_comp): Handle function parameters. Fix bug with
function used in type of function. function used in type of function.
* testsuite/demangle-expected: Upate tests. * testsuite/demangle-expected: Update tests.
2009-02-21 Mark Mitchell <mark@codesourcery.com> 2009-02-21 Mark Mitchell <mark@codesourcery.com>

View File

@ -1,5 +1,5 @@
/* Demangler for g++ V3 ABI. /* 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. Free Software Foundation, Inc.
Written by Ian Lance Taylor <ian@wasabisystems.com>. 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. */ /* For demangling we don't care about the bits. */
d_number (di); d_number (di);
ret->u.s_fixed.length = cplus_demangle_type (di); ret->u.s_fixed.length = cplus_demangle_type (di);
if (ret->u.s_fixed.length == NULL)
return NULL;
d_number (di); d_number (di);
peek = d_next_char (di); peek = d_next_char (di);
ret->u.s_fixed.sat = (peek == 's'); ret->u.s_fixed.sat = (peek == 's');

View File

@ -4019,5 +4019,8 @@ prot.lock.update
--format=gnat --format=gnat
prot__lock__update_E6s prot__lock__update_E6s
prot.lock.update prot.lock.update
#
# Used to crash the demangler.
--format=gnu-v3
DFA
DFA