aboutsummaryrefslogtreecommitdiff
path: root/libiberty/cp-demangle.h
AgeCommit message (Collapse)AuthorFilesLines
2015-11-28Fix several crashes of C++ demangler on fuzzed input.Mikhail Maltsev1-2/+27
libiberty/ * cp-demangle.c (d_dump): Fix syntax error. (d_identifier): Adjust type of len to match d_source_name. (d_expression_1): Fix out-of-bounds access. Check code variable for NULL before dereferencing it. (d_find_pack): Do not recurse for FIXED_TYPE, DEFAULT_ARG and NUMBER. (d_print_comp_inner): Add NULL pointer check. * cp-demangle.h (d_peek_next_char): Define as inline function when CHECK_DEMANGLER is defined. (d_advance): Likewise. * testsuite/demangle-expected: Add new testcases. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@225727 138bc75d-0d04-0410-961f-82ee72b054a4
2013-11-26Fix demangler to handle conversion operators correctly.ccoutant1-0/+5
libiberty/ PR other/59195 * cp-demangle.c (struct d_info_checkpoint): New struct. (struct d_print_info): Add current_template field. (d_operator_name): Set flag when processing a conversion operator. (cplus_demangle_type): When processing <template-args> for a conversion operator, backtrack if necessary. (d_expression_1): Renamed from d_expression. (d_expression): New wrapper around d_expression_1. (d_checkpoint): New function. (d_backtrack): New function. (d_print_init): Initialize current_template. (d_print_comp): Set current_template. (d_print_cast): Put current_template in scope for printing conversion operator name. (cplus_demangle_init_info): Initialize is_expression and is_conversion. * cp-demangle.h (struct d_info): Add is_expression and is_conversion fields. * testsuite/demangle-expected: New test cases. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@205292 138bc75d-0d04-0410-961f-82ee72b054a4
2011-01-03merge from gccDJ Delorie1-1/+2
2010-05-06merge from gccDJ Delorie1-1/+1
2008-10-07merge from gccDJ Delorie1-1/+1
2007-01-30merge from gccDJ Delorie1-3/+4
2006-12-21 * cp-demangle.h: Add comment explaining what to do to avoidGeoffrey Keating1-1/+7
overrunning string. (d_check_char): New. (d_next_char): Don't advance past trailing '\0'. * cp-demangle.c (cplus_demangle_mangled_name): Use d_check_char. (d_nested_name): Likewise. (d_special_name): Likewise. (d_call_offset): Likewise. (d_function_type): Likewise. (d_array_type): Likewise. (d_pointer_to_member_type): Likewise. (d_template_param): Likewise. (d_template_args): Likewise. (d_template_arg): Likewise. (d_expr_primary): Likewise. (d_local_name): Likewise. (d_substitution): Likewise. (d_ctor_dtor_name): Use d_advance rather than d_next_char. * testsuite/test-demangle.c: Include sys/mman.h. (MAP_ANONYMOUS): Define. (protect_end): New. (main): Use protect_end. * testsuite/demangle-expected: Add testcases for overrunning the end of the string.
2005-05-10Update the address and phone number of the FSF organization.Nick Clifton1-1/+1
2005-03-27merge from gccDJ Delorie1-3/+3
2004-06-28merge from gccDJ Delorie1-4/+16
2004-02-25merge from gccDJ Delorie1-1/+11
2004-01-12merge from gccDJ Delorie1-0/+139