aboutsummaryrefslogtreecommitdiff
path: root/libiberty/cplus-dem.c
AgeCommit message (Collapse)AuthorFilesLines
5 dayslibiberty: Fix comment typosMark Wielaard1-1/+1
These comment typos were found in the valgrind fork of libiberty demangle code. libiberty/ChangeLog: * cplus-dem.c: Change preceeded to preceded. include/ChangeLog: * safe-ctype.h: Change accidently to accidentally.
2024-04-02libiberty: Invoke D demangler when --format=autoTom Tromey1-1/+1
Investigating GDB PR d/31580 showed that the libiberty demangler doesn't automatically demangle D mangled names. However, I think it should -- like C++ and Rust (new-style), D mangled names are readily distinguished by the leading "_D", and so the likelihood of confusion is low. The other non-"auto" cases in this code are Ada (where the encoded form could more easily be confused by ordinary programs) and Java (which is long gone, but which also shared the C++ mangling and thus was just an output style preference). This patch also fixed another GDB bug, though of course that part won't apply to the GCC repository. Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=31580 Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=30276 libiberty * cplus-dem.c (cplus_demangle): Try the D demangler with "auto" format. * testsuite/d-demangle-expected: Add --format=auto test.
2024-01-03Update copyright years.Jakub Jelinek1-1/+1
2023-01-16Update copyright years.Jakub Jelinek1-1/+1
2022-01-03Update copyright years.Jakub Jelinek1-1/+1
2021-01-04Update copyright years.Jakub Jelinek1-1/+1
2020-01-01Update copyright years.Jakub Jelinek1-1/+1
From-SVN: r279813
2019-11-16[PATCH] Refactor rust-demangle to be independent of C++ demangling.Eduard-Mihai Burtescu1-40/+11
* demangle.h (rust_demangle_callback): Add. * cplus-dem.c (cplus_demangle): Use rust_demangle directly. (rust_demangle): Remove. * rust-demangle.c (is_prefixed_hash): Rename to is_legacy_prefixed_hash. (parse_lower_hex_nibble): Rename to decode_lower_hex_nibble. (parse_legacy_escape): Rename to decode_legacy_escape. (rust_is_mangled): Remove. (struct rust_demangler): Add. (peek): Add. (next): Add. (struct rust_mangled_ident): Add. (parse_ident): Add. (rust_demangle_sym): Remove. (print_str): Add. (PRINT): Add. (print_ident): Add. (rust_demangle_callback): Add. (struct str_buf): Add. (str_buf_reserve): Add. (str_buf_append): Add. (str_buf_demangle_callback): Add. (rust_demangle): Add. * rust-demangle.h: Remove. From-SVN: r278358
2019-07-18demangle.h (rust_is_mangled): Move to libiberty/rust-demangle.h.Eduard-Mihai Burtescu1-0/+1
include/ * demangle.h (rust_is_mangled): Move to libiberty/rust-demangle.h. (rust_demangle_sym): Move to libiberty/rust-demangle.h. libiberty/ * cplus-dem.c: Include rust-demangle.h. * rust-demangle.c: Include rust-demangle.h. * rust-demangle.h: New file. From-SVN: r273573
2019-01-01Update copyright years.Jakub Jelinek1-1/+1
From-SVN: r267494
2018-12-22Remove support for demangling GCC 2.x era mangling schemes.Jason Merrill1-4581/+5
libiberty/ * cplus-dem.c: Remove cplus_mangle_opname, cplus_demangle_opname, internal_cplus_demangle, and all subroutines. (libiberty_demanglers): Remove entries for ancient GNU (pre-3.0), Lucid, ARM, HP, and EDG demangling styles. (cplus_demangle): Remove 'work' variable. Don't call internal_cplus_demangle. include/ * demangle.h: Remove support for ancient GNU (pre-3.0), Lucid, ARM, HP, and EDG demangling styles. From-SVN: r267363
2018-12-07Add a recursion limit to libiberty's demangling code. The limit is enabled ↵Nick Clifton1-2/+35
by default, but can be disabled via a new demangling option. include * demangle.h (DMGL_NO_RECURSE_LIMIT): Define. (DEMANGLE_RECURSION_LIMIT): Define PR 87681 PR 87675 PR 87636 PR 87350 PR 87335 libiberty * cp-demangle.h (struct d_info): Add recursion_level field. * cp-demangle.c (d_function_type): Add recursion counter. If the recursion limit is reached and the check is not disabled, then return with a failure result. (cplus_demangle_init_info): Initialise the recursion_level field. (d_demangle_callback): If the recursion limit is enabled, check for a mangled string that is so long that there is not enough stack space for the local arrays. * cplus-dem.c (struct work): Add recursion_level field. (squangle_mop_up): Set the numb and numk fields to zero. (work_stuff_copy_to_from): Handle the case where a btypevec or ktypevec field is NULL. (demangle_nested_args): Add recursion counter. If the recursion limit is not disabled and reached, return with a failure result. From-SVN: r266886
2018-07-30cplus-dem.c (remember_Btype): Don't call memcpy with LEN==0.Tom Tromey1-1/+2
2018-07-30 Tom Tromey <tom@tromey.com> * cplus-dem.c (remember_Btype): Don't call memcpy with LEN==0. From-SVN: r263069
2018-01-03Update copyright years.Jakub Jelinek1-1/+1
From-SVN: r256169
2017-04-27PR demangler/80513 check for overflows and invalid characters in thunksJonathan Wakely1-9/+7
PR demangler/80513 * cp-demangle.c (d_number): Check for overflow. * cplus-dem.c (consume_count): Fix overflow check. (gnu_special): Check for underscore after thunk delta. * testsuite/demangle-expected: Add tests for overflows and invalid characters in thunks. From-SVN: r247300
2017-01-04Update copyright years.Jakub Jelinek1-2/+1
From-SVN: r244052
2016-11-16libiberty: Add Rust symbol demangling.David Tolnay1-2/+45
Adds Rust symbol demangler. Rust mangles symbols using GNU_V3 style, adding a hash and various special character subtitutions. This adds a new rust style to cplus_demangle and adds 3 helper functions rust_demangle, rust_demangle_sym and rust_is_mangled. rust-demangle.c was written by David. Mark did the code formatting to GNU style and integration into the gcc/libiberty build system and testsuite. include/ChangeLog: 2016-11-03 David Tolnay <dtolnay@gmail.com> Mark Wielaard <mark@klomp.org> * demangle.h (DMGL_RUST): New macro. (DMGL_STYLE_MASK): Add DMGL_RUST. (demangling_styles): Add dlang_rust. (RUST_DEMANGLING_STYLE_STRING): New macro. (RUST_DEMANGLING): New macro. (rust_demangle): New prototype. (rust_is_mangled): Likewise. (rust_demangle_sym): Likewise. libiberty/ChangeLog: 2016-11-03 David Tolnay <dtolnay@gmail.com> Mark Wielaard <mark@klomp.org> * Makefile.in (CFILES): Add rust-demangle.c. (REQUIRED_OFILES): Add rust-demangle.o. * cplus-dem.c (libiberty_demanglers): Add rust_demangling case. (cplus_demangle): Handle RUST_DEMANGLING. (rust_demangle): New function. * rust-demangle.c: New file. * testsuite/Makefile.in (really-check): Add check-rust-demangle. (check-rust-demangle): New rule. * testsuite/rust-demangle-expected: New file. Co-Authored-By: Mark Wielaard <mark@klomp.org> From-SVN: r242524
2016-11-15libiberty: Fix some demangler crashes caused by reading past end of input.Mark Wielaard1-4/+10
In various situations the cplus_demangle () function could read past the end of input causing crashes. Add checks in various places to not advance the demangle string location and fail early when end of string is reached. Add various examples of input strings to the testsuite that would crash test-demangle before the fixes. Found by using the American Fuzzy Lop (afl) fuzzer. libiberty/ChangeLog: * cplus-dem.c (demangle_signature): After 'H', template function, no success and don't advance position if end of string reached. (demangle_template): After 'z', template name, return zero on premature end of string. (gnu_special): Guard strchr against searching for zero characters. (do_type): If member, only advance mangled string when 'F' found. * testsuite/demangle-expected: Add examples of strings that could crash the demangler by reading past end of input. From-SVN: r242450
2016-11-04libiberty: Fix -Wimplicit-fallthrough warnings.Mark Wielaard1-3/+2
Adjust some comments, add some explicit fall through comments or explicit returns where necessary to not get implicit-fallthrough warnings. All fall throughs were deliberate. In one case I added an explicit return false for clarity instead of falling through a default case (that also would return false). libiberty/ChangeLog: * cplus-dem.c (demangle_signature): Move fall through comment. (demangle_fund_type): Add fall through comment between 'G' and 'I'. * hashtab.c (iterative_hash): Add fall through comments. * regex.c (regex_compile): Add Fall through comment after '+'/'?'. (byte_re_match_2_internal): Add Fall through comment after jump_n. Change "Note fall through" to "Fall through". (common_op_match_null_string_p): Return false after set_number_at instead of fall through. From-SVN: r241864
2016-11-01libiberty: Fix memory leak in ada_demangle when symbol cannot be demangled.Mark Wielaard1-1/+2
When a symbol cannot be demangled in ada_demangle a new demangled VEC will be allocated without deleting the demangled VEC already in use. Running testsuite/test-demangle under valgrind will show the leak for this entry in testsuite/demangle-expected: # Elaborated flag (not demangled) --format=gnat x_E <x_E> 11 bytes in 1 blocks are definitely lost in loss record 1 of 1 at 0x4C27BE3: malloc (vg_replace_malloc.c:299) by 0x413FE7: xmalloc (xmalloc.c:148) by 0x4025EC: ada_demangle (cplus-dem.c:930) by 0x402C59: cplus_demangle (cplus-dem.c:892) by 0x400FEC: main (test-demangle.c:317) libiberty/ChangeLog: * cplus-dem.c (ada_demangle): Initialize demangled to NULL and XDELETEVEC demangled when unknown. From-SVN: r241760
2016-08-04re PR c++/71696 (Libiberty Demangler segfaults (6))Marcel Böhme1-6/+74
2016-08-04 Marcel Böhme <boehme.marcel@gmail.com> PR c++/71696 * cplus-dem.c: Prevent infinite recursion when there is a cycle in the referencing of remembered mangled types. (work_stuff): New stack to keep track of the remembered mangled types that are currently being processed. (push_processed_type): New method to push currently processed remembered type onto the stack. (pop_processed_type): New method to pop currently processed remembered type from the stack. (work_stuff_copy_to_from): Copy values of new variables. (delete_non_B_K_work_stuff): Free stack memory. (demangle_args): Push/Pop currently processed remembered type. (do_type): Do not demangle a cyclic reference and push/pop referenced remembered type. From-SVN: r239143
2016-07-13re PR c++/70926 (Libiberty Demangler segfaults (5))Marcel Böhme1-4/+6
PR c++/70926 * cplus-dem.c: Handle large values and overflow when demangling length variables. (demangle_template_value_parm): Read only until end of mangled string. (do_hpacc_template_literal): Likewise. (do_type): Handle overflow when demangling array indices. From-SVN: r238313
2016-05-18cplus-dem.c (enum type_kind_t): Add tk_rvalue_reference constant.Artemiy Volkov1-2/+11
* cplus-dem.c (enum type_kind_t): Add tk_rvalue_reference constant. (demangle_template_value_parm): Handle tk_rvalue_reference type kind. (do_type): Support 'O' type id (rvalue references). * testsuite/demangle-expected: Add tests. From-SVN: r236434
2016-04-08Fix memory allocation size overflows (PR69687, patch by Marcel Böhme)Marcel Böhme1-0/+15
PR c++/69687 * cplus-dem.c: Include <limits.h> if available. (INT_MAX): Define if necessary. (remember_type, remember_Ktype, register_Btype, string_need): Abort if we detect cases where we the size of the allocation would overflow. From-SVN: r234829
2016-04-08Handle an overflow case (PR70498, patch by Marcel Böhme).Marcel Böhme1-0/+5
PR c++/70498 * cplus-dem.c (gnu_special): Handle case where consume_count returns -1. From-SVN: r234828
2016-03-31cplus-dem.c (squangle_mop_up): Zero bsize/ksize after freeing btypevec/ktypevec.Mikhail Maltsev1-0/+2
* cplus-dem.c (squangle_mop_up): Zero bsize/ksize after freeing btypevec/ktypevec. * testsuite/demangle-expected: Add coverage tests. From-SVN: r234645
2014-09-23demangle.h (DMGL_DLANG): New macro.Iain Buclaw1-0/+13
include/: * demangle.h (DMGL_DLANG): New macro. (DMGL_STYLE_MASK): Add DMGL_DLANG. (demangling_styles): Add dlang_demangling. (DLANG_DEMANGLING_STYLE_STRING): New macro. (DLANG_DEMANGLING): New macro. (dlang_demangle): New prototype. libiberty/: * Makefile.in (CFILES): Add d-demangle.c. (REQUIRED_OFILES): Add d-demangle.o. * cplus-dem.c (libiberty_demanglers): Add dlang_demangling case. (cplus_demangle): Likewise. * d-demangle.c: New file. * testsuite/Makefile.in (really-check): Add check-d-demangle. * testsuite/d-demangle-expected: New file. From-SVN: r215530
2014-06-11Delete temporary string within demangler even in failure cases.Andrew Burgess1-1/+4
A call to demangle_template might allocate storage within a temporary string even if the call to demangle_template eventually returns failure. This will never cause the demangler to crash, but does leak memory, as a result I've not added any tests for this. Calling string_delete is safe, even if nothing is allocated into the string, the string is initialised with string_init, so we know the internal pointers are NULL. libiberty/ChangeLog * cplus-dem.c (do_type): Call string_delete even if the call to demangle_template fails. From-SVN: r211449
2014-05-14cplus-dmem.c (internal_cplus_demangle): Free any resources allocated by ↵Andrew Burgess1-0/+7
possible previous call to gnu_special. libiberty/ 2014-05-14 Andrew Burgess <aburgess@broadcom.com> * cplus-dmem.c (internal_cplus_demangle): Free any resources allocated by possible previous call to gnu_special. (squangle_mop_up): Reset pointers to NULL after calling free. * testsuite/demangle-expected: New test case. From-SVN: r210425
2011-04-20remove useless if-before-free testsJim Meyering1-2/+1
Change "if (E) free (E);" to "free (E);" everywhere except in the libgo/, intl/, zlib/ and classpath/ directories. Also transform equivalent variants like "if (E != NULL) free (E);" and allow an extra cast on the argument to free. Otherwise, the tested and freed "E" expressions must be identical, modulo white space. From-SVN: r172785
2011-01-03Update Copyright years for files modified in 2010.Jakub Jelinek1-1/+1
From-SVN: r168438
2010-09-22cplus-dem.c (ada_demangle): Add comments.Tristan Gingold1-63/+137
2010-09-22 Tristan Gingold <gingold@adacore.com> * cplus-dem.c (ada_demangle): Add comments. Handle stream and controlled type operations. Decoding of some uppercase letters moved before separators. * testsuite/demangle-expected: Add tests. From-SVN: r164518
2010-01-11demangle.h (ada_demangle): Add prototype.Tristan Gingold1-108/+169
include/ 2010-01-11 Tristan Gingold <gingold@adacore.com> * demangle.h (ada_demangle): Add prototype. libiberty/ 2010-01-11 Tristan Gingold <gingold@adacore.com> * cplus-dem.c (ada_demangle): Remove prototype. (grow_vect): Removed. (ada_demangle): Rewritten. (cplus_demangle): Fix indentation. * testsuite/demangle-expected: Add tests for Ada. From-SVN: r155804
2009-09-23cplus-dem.c (ada_demangle): Ensure demangled is freed.Matthew Gingell1-1/+4
2009-09-23 Matthew Gingell <gingell@adacore.com> * cplus-dem.c (ada_demangle): Ensure demangled is freed. From-SVN: r152060
2008-03-13cplus-dem.c (malloc, realloc): Use void * instead of char * as return type.Seongbae Park1-2/+2
2008-03-12 Seongbae Park <seongbae.park@gmail.com> * cplus-dem.c (malloc, realloc): Use void * instead of char * as return type. From-SVN: r133181
2008-01-23cplus-dem.c (demangle_function_name): Changed to return value indicating if ↵Thiago Jung Bauermann1-12/+20
a name was correctly demangled. 2008-01-23 Thiago Jung Bauermann <bauerman@br.ibm.com> * cplus-dem.c (demangle_function_name): Changed to return value indicating if a name was correctly demangled. (iterate_demangle_function): Use demangle_function_name return value. From-SVN: r131754
2006-05-12cplus-dem.c (demangle_fund_type): Ensure buf is large enough to hold "int%u_t".Anton Blanchard1-1/+1
* cplus-dem.c (demangle_fund_type): Ensure buf is large enough to hold "int%u_t". From-SVN: r113728
2005-05-24libiberty.h (ACONCAT): Properly cast value of alloca().Gabriel Dos Reis1-39/+29
include/ 2005-05-24 Gabriel Dos Reis <gdr@integrable-solutions.net> * libiberty.h (ACONCAT): Properly cast value of alloca(). * ansidecl.h (ATTRIBUTE_UNUSED_LABEL): Don't define if __cplusplus. libiberty/ 2005-05-24 Gabriel Dos Reis <gdr@integrable-solutions.net> * configure.ac: Check declarations for calloc(), getenv(), malloc(), realloc() and sbrk(). * config.in: Regenerate. * configure: Likewise. * alloca.c (C_alloca): Change "new" to "new_storage". Use XNEWVEC instead of xmalloc. * choose-temp.c (choose_temp_base): Use XNEWVEC instea od xmalloc. * concat.c (liiberty_concat_ptr): Surround definition with an extern "C" block, if __cplusplus. (concat): Use XNEWVEC instead of xmalloc. (reconcat): Likewise. * cp-demangle.c (struct d_print_template): Rename member "template" to "template_decl". Adjust use throughout the file. (d_print_resize): Properly cast return value of realloc(). (cplus_demangle_print): Same for malloc(). (d_demangle): Likewise. * cp-demint.c (cplus_demangle_fill_builtin_type): Rename parameter "typename" to "type_name". * cplus-dem.c (grow_vect): Use XRESIZEVEC instead of xrealloc(). (work_stuff_copy_to_from): Use XNEWVEC insteand of xmalloc(). (demangle_template_value_parm): Likewise. (demangle_template): Likewise. (recursively_demangle): Likewise. (do_hpacc_template_literal): Likewise. (do_arg): Likewise. (remember_type): Likewise. (remember_Ktype): Likewise. (register_Btype): Likewise. (string_need): Use XRESIZEVEC instead of xrealloc(). * dyn-string.c (dyn_string_init): Use XNEWVEC. (dyn_string_new): Use XNEW. (dyn_string_resize): Use XRESIZEVEC. * fnmatch.c (fnmatch): Rename local variable "not" to "negate". * getopt.c (getenv): Declare only if !__cplusplus and !getenv. Otherwise include <stdlib.h>. (exchange): Cast return value of malloc(). * hashtab.c (htab_size): Define as both macro and non-inline function. (htab_elements): Likewise. * getpwd.c (getpwd): Use XNEWVEC. (htab_create_alloc_ex): Use C90 prototype-style. * lrealpath.c (lrealpath): Appropriately cast return value of malloc(). * make-relative-prefix.c (save_string): Likewise. * make-temp-file.c (try_dir): Rename from "try". Adjust use in the file. (choose_tmpdir): Use XNEWVEC. * mkstemps.c (mkstemps): Rename parameter "template" to "pattern". * pex-common.c (pex_init_common): Use XNEW. (pex_add_remove): Use XRESIZEVEC. (pex_run): Likewise. (pex_get_status_and_time): Likewise. * pex-djgpp.c (pex_djgpp_exec_child): Likewise. * pex-msdos.c (pex_init): Use XNEW. (pex_msdos_exec_child): Likewise. (pex_msdos_exec_child): Use XRESIZEVEC. * pex-unix.c (pex_wait): Use XNEW. * pex-win32.c (fix_argv): Use XNEWVEC. * pexecute.c (pwait): Likewise. * setenv.c (setenv): Properly cast return value of malloc(). * sigsetmask.c (sigsetmask): Rename local variables "old" and "new" to "old_sig" and "new_sig". * sort.c (main): Use XNEWVEC. * spaces.c (spaces): Cast return value of malloc(). * strndup.c (strndup): Likewise. * ternary.c (ternary_insert): Use XNEW. * xmalloc.c (malloc, realloc, calloc, sbrk): Surround declaration with an extern "C" block if __cplusplus. * xstrdup.c (xstrdup): Cast return value of memcpy(). * xstrerror.c (strerror): Enclose declaration in an extern "C" block if __cplusplus. * xstrndup.c (xstrndup): Use XNEW. Cast return value of memcpy(). From-SVN: r100115
2005-05-10Update the address and phone number of the FSF organization.Nick Clifton1-2/+2
From-SVN: r99519
2005-03-27Convert libiberty to use ISO C prototype style 3/n.Gabriel Dos Reis1-333/+156
* cplus-dem.c (set_cplus_marker_for_demangling, consume_count, consume_count_with_underscores, code_for_qualifier, qualifier_string, demangle_qualifier, cplus_demangle_opname, cplus_mangle_opname, cplus_demangle_set_style, cplus_demangle_name_to_style, cplus_demangle, grow_vect, ada_demangle, internal_cplus_demangle, squangle_mop_up, work_stuff_copy_to_from, delete_non_B_K_work_stuff, delete_work_stuff, mop_up, demangle_signature, demangle_method_args, demangle_template_template_parm, demangle_expression, demangle_integral_value, demangle_real_value, demangle_template_value_parm, demangle_template, arm_pt, demangle_arm_hp_template, demangle_class_name, demangle_class, iterate_demangle_function, demangle_prefix, gnu_special, recursively_demangle, arm_special, demangle_qualified, get_count, do_type, demangle_fund_type, do_hpacc_template_const_value, do_hpacc_template_literal, snarf_numeric_literal, do_arg, remember_type, remember_Ktype, register_Btype, remember_Btype, forget_B_and_K_types, forget_types, demangle_args, demangle_nested_args, demangle_function_name, string_need, string_delete, string_init, string_clear, string_empty, string_append, string_appends, string_appendn, string_prepend, string_prepends, string_prependn, string_append_template_idx): Use ISO C prootype style. * cp-demint.c (cplus_demangle_fill_component, cplus_demangle_fill_builtin_type, cplus_demangle_fill_operator, cplus_demangle_v3_components): Likewise. From-SVN: r97109
2004-11-24re PR other/18623 (4 * libiberty local variables set but never used)Ian Lance Taylor1-7/+1
PR other/18623 * cp-demangle.c (d_call_offset): Remove useless local variables offset and virtual_offset. * cplus-dem.c (ada_demangle): Remove useless local variable at_start_name. (demangle_template): Remove useless local variable start. From-SVN: r91133
2004-01-02cp-demangle.c (d_encoding): When DMGL_PARAMS is not set...Ian Lance Taylor1-2/+21
* cp-demangle.c (d_encoding): When DMGL_PARAMS is not set, strip CV-qualifiers from D_COMP_LOCAL_NAME right subtree. * cplus-dem.c (demangle_arm_hp_template): Set DMGL_PARAMS when demangling template parameters. * testsuite/test-demangle.c (fail): New static function. (main): Support new options in input file: --no-params, --is-v3-ctor, and --is-v3-dtor. * testsuite/demangle-expected: Add --no-params to most tests, and add the correct result when parameters are not demangled. Add some simple tests for V3 constructor/destructor recognition. From-SVN: r75336
2003-10-20cplus-dem.c (demangle_template): Register a new Btype only when needed.J. Brobecker1-4/+4
* cplus-dem.c (demangle_template): Register a new Btype only when needed. * testsuite/demangle-expected: Add a new test. From-SVN: r72729
2003-03-11cplus-dem.c (demangle_integral_value): Correction to reflect patch of ↵Carlo Wood1-23/+26
2002-01-10 in order to also make negative... * cplus-dem.c (demangle_integral_value): Correction to reflect patch of 2002-01-10 in order to also make negative multi-digits without leading underscore work. From-SVN: r64179
2003-03-04* cplus-dem.c: Add license exception to copyright notice.Mark Mitchell1-0/+9
From-SVN: r63760
2003-02-20* cplus_dem.c: Fix typo: intializes -> initializes.jmc1-1/+1
From-SVN: r63182
2003-02-13re PR c++/7612 (Memory leaks in cplus-dem.c)Daniel Jacobowitz1-15/+16
Fix PR c++/7612. * cplus-dem.c (demangle_signature): Call string_delete. Remove extra string_init. (demangle_arm_hp_template): Call string_delete instead of string_clear. Add missing string_delete call. (demangle_qualified): Add missing string_delete call. (do_type): Remove unused variable btype. Add missing string_delete call. Call string_delete instead of string_clear. (demangle_fund_type): Move variable btype inside of the switch statement. Add missing string_delete call. (do_arg): Call string_delete instead of string_clear. Remove extra string_init. (demangle_nested_args): Free work->previous_argument. From-SVN: r62852
2002-10-06cplus-dem.c (ada_demangle): Get rid of unneeded variable and of ↵Andreas Jaeger1-10/+8
strict-aliasing warning. * libiberty/cplus-dem.c (ada_demangle): Get rid of unneeded variable and of strict-aliasing warning. (grow_vect): Use char as first parameter. From-SVN: r57866
2002-09-20cp-demangle.c (demangling_new): Cast 0 to enum.John David Anglin1-2/+2
* cp-demangle.c (demangling_new): Cast 0 to enum. (demangle_char): Cast return of strdup to char *. (is_gnu_v3_mangled_ctor): Cast 0 to enum. (is_gnu_v3_mangled_dtor): Likewise. * cplus-dem.c (grow_vect): Cast return of xrealloc to void *. (work_stuff_copy_to_from): Cast return of xmalloc to char **. * fibheap.c (fibnode_new): Cast return of xcalloc to fibnode_t. * md5.c (md5_process_bytes): Cast results back to const void *. (md5_process_block): Add cast to const md5_uint32 *. * regex.c (re_compile_fastmap): Cast enum to UCHAR_T. * safe-ctype.c (L, XL, U, XU, D, P, _, C, Z, M, V, T, S): Add cast to unsigned short. * splay-tree.c (splay_tree_xmalloc_allocate): Cast return of xmalloc to void *. * vasprintf.c (int_vasprintf): Cast return of malloc to char *. From-SVN: r57330
2002-09-11Makefile.in: Remove all references to s-under and underscore.c.Zack Weinberg1-334/+0
gcc: * Makefile.in: Remove all references to s-under and underscore.c. * collect2.c, tlink.c: Change all uses of prepends_underscore to look directly at USER_LABEL_PREFIX. gcc/cp: * Make-lang.in: Build cp/cxxfilt.o from $(srcdir)/cp/cxxfilt.c, and c++filt from cxxfilt.o + version.o + $(LIBDEPS). * cxxfilt.c: New file: split from libiberty/cplus-dem.c, with minor adjustments (use version_string, eliminate yet another duplicate of xmalloc) libiberty: * cplus-dem.c: Code code under #ifdef MAIN moved to gcc/cp/cxxfilt.c. * testsuite/Makefile.in: Adjust for test-demangle. * testsuite/regress-demangle: Deleted. * testsuite/test-demangle.c: New file. * testsuite/demangle-expected: Change \$ to $ throughout, now that this file is not being read by a shell script. From-SVN: r57037