summaryrefslogtreecommitdiff
path: root/libiberty
Commit message (Collapse)AuthorAgeFilesLines
* Delete temporary string within demangler even in failure cases.gdb-7.8-branchpointAndrew Burgess2014-06-112-1/+9
| | | | | | | | | | | | | | | | | 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.
* 2014-06-01 Ray Donnelly <mingw.android@gmail.com>Kai Tietz2014-06-012-9/+42
| | | | | * pex-win32.c (argv_to_cmdline): Don't quote args unnecessarily.
* Fix demangler testsuite crashes with CP_DEMANGLE_DEBUG definedPedro Alves2014-05-282-0/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | Running the demangler's testsuite with CP_DEMANGLE_DEBUG defined crashes, with: Program received signal SIGSEGV, Segmentation fault. 0x000000000040a8c3 in d_dump (dc=0x1, indent=12) at ../../src/libiberty/cp-demangle.c:567 567 switch (dc->type) (gdb) bt 3 #0 0x000000000040a8c3 in d_dump (dc=0x1, indent=12) at ../../src/libiberty/cp-demangle.c:567 #1 0x000000000040ae47 in d_dump (dc=0x7fffffffd098, indent=10) at ../../src/libiberty/cp-demangle.c:787 #2 0x000000000040ae47 in d_dump (dc=0x7fffffffd0c8, indent=8) at ../../src/libiberty/cp-demangle.c:787 Note dc=0x1, which is obviously a bogus pointer. This is the end of d_dump recursing for a component type that that doesn't actually have subtrees: 787 d_dump (d_left (dc), indent + 2); 788 d_dump (d_right (dc), indent + 2); This fixes the two cases the testsuite currently trips on. libiberty/ 2014-05-28 Pedro Alves <palves@redhat.com> * cp-demangle.c (d_dump): Handle DEMANGLE_COMPONENT_FUNCTION_PARAM and DEMANGLE_COMPONENT_NUMBER.
* Fix test in libiberty/testsuite/demangle-expected.Thomas Schwinge2014-05-282-0/+5
| | | | | | | libiberty/ * testsuite/demangle-expected: Fix last commit. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@210803 138bc75d-0d04-0410-961f-82ee72b054a4
* cplus-demangler, free resource after a failed call to gnu_special.Andrew Burgess2014-05-283-0/+18
| | | | | | | | | | | | 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. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@210425 138bc75d-0d04-0410-961f-82ee72b054a4
* libiberty/ 2014-05-08 Gary Benson <gbenson@redhat.com>gary2014-05-083-6/+90
| | | | | | | | | | | | * cp-demangle.c (struct d_component_stack): New structure. (struct d_print_info): New field component_stack. (d_print_init): Initialize the above. (d_print_comp_inner): Renamed from d_print_comp. Do not restore template stack if it would cause a loop. (d_print_comp): New function. * testsuite/demangle-expected: New test cases. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@210205 138bc75d-0d04-0410-961f-82ee72b054a4
* PR sanitizer/56781 lto-plugin/ * Makefile.am (CFLAGS, LDFLAGS): Filter out ↵jakub2014-05-085-9/+405
| | | | | | -fsanitize=address. (liblto_plugin_la_LIBADD, liblto_plugin_la_LDFLAGS, liblto_plugin_la_DEPENDENCIES): Prefer ../libiberty/noasan/libiberty.a over ../libiberty/pic/libiberty.a if the former exists. * Makefile.in: Regenerated. libiberty/ * maint-tool: Also emit rule for noasan/ subdirectory. * configure.ac (NOASANFLAG): Set and substitute. * Makefile.in: Regenerated. (NOASANFLAG): Set. (all, $(TARGETLIB), mostlyclean): Handle noasan subdir like pic subdir. (stamp-noasandir): New goal. * configure: Regenerated. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@209476 138bc75d-0d04-0410-961f-82ee72b054a4
* 2014-04-01 Richard Biener <rguenther@suse.de>rguenth2014-05-082-8/+22
| | | | | | | | libiberty/ * simple-object.c (simple_object_internal_write): Handle EINTR and short writes. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@208972 138bc75d-0d04-0410-961f-82ee72b054a4
* 2014-03-28 Richard Biener <rguenther@suse.de>rguenth2014-05-082-8/+22
| | | | | | | | | | | libiberty/ * simple-object.c (simple_object_internal_read): Handle EINTR and short reads. lto-plugin/ * lto-plugin.c (process_symtab): Handle EINTR and short reads. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@208898 138bc75d-0d04-0410-961f-82ee72b054a4
* * regex.c (bzero) [!_LIBC]: Cast the call to memcpy to (void).uros2014-05-081-1/+1
| | | | git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@208558 138bc75d-0d04-0410-961f-82ee72b054a4
* * regex.c (bzero) [!_LIBC]: Define without coma expression. (regerror): Cast ↵uros2014-05-082-3/+9
| | | | | | the call to memcpy to (void) to avoid unused value warnings. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@208553 138bc75d-0d04-0410-961f-82ee72b054a4
* Avoid "'dc' may be uninitialized" warning.tschwinge2014-05-082-1/+8
| | | | | | | | libiberty/ * cp-demangle.c (d_demangle_callback): Put an abort call in place, to help the compiler. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@207200 138bc75d-0d04-0410-961f-82ee72b054a4
* [PATCH] include * ansidecl.h (ANSI_PROTOTYPES, PTRCONST, LONG_DOUBLE, ↵tromey2014-01-217-49/+49
| | | | | | PARAMS) (VPARAMS, VA_START, VA_OPEN, VA_CLOSE, VA_FIXEDARG, CONST) (VOLATILE, SIGNED, PROTO, EXFUN, DEFUN, DEFUN_VOID, AND, DOTS) (NOARGS): Don't define. * libiberty.h (expandargv, writeargv): Don't use PARAMS. libiberty * _doprint.c (checkit): Use stdarg, not VA_* macros. * asprintf.c (asprintf): Use stdarg, not VA_* macros. * concat.c (concat_length, concat_copy, concat_copy2, concat) (reconcat): Use stdarg, not VA_* macros. * snprintf.c (snprintf): Use stdarg, not VA_* macros. * vasprintf.c (checkit): Use stdarg, not VA_* macros. * vsnprintf.c (checkit): Use stdarg, not VA_* macros. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@206881 138bc75d-0d04-0410-961f-82ee72b054a4
* libiberty: fix --enable-install-libiberty flag [PR 56780]Mike Frysinger2014-01-063-2/+6
| | | | | | | | | Commit 199570 fixed the --disable-install-libiberty behavior, but it also added a bug where the enable path never works because the initial clear of target_header_dir wasn't deleted. So we end up initializing properly at the top only to reset it at the end all the time. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@206367 138bc75d-0d04-0410-961f-82ee72b054a4
* libiberty: sync with gccGary Benson2014-01-062-61/+223
| | | | | | | | | | | | | | | | | | | | | libiberty/ 2014-01-06 Gary Benson <gbenson@redhat.com> * cp-demangle.c (struct d_print_info): New fields next_saved_scope, copy_templates, next_copy_template and num_copy_templates. (d_count_templates): New function. (d_print_init): New parameter "dc". Estimate numbers of templates and scopes required. (d_print_free): Removed function. (cplus_demangle_print_callback): Allocate stack for templates and scopes. Removed call to d_print_free. (d_copy_templates): Removed function. (d_save_scope): New function. (d_get_saved_scope): Likewise. (d_print_comp): Replace state saving/restoring code with calls to d_save_scope and d_get_saved_scope. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@206362 138bc75d-0d04-0410-961f-82ee72b054a4
* libiberty: sync with gccBill Maddox2014-01-062-0/+13
| | | | | | | | | | | | | | | | PR c++/41090 Add -fdeclone-ctor-dtor. include/ * demangle.h (enum gnu_v3_ctor_kinds): Added literal gnu_v3_unified_ctor. (enum gnu_v3_ctor_kinds): Added literal gnu_v3_unified_dtor. libiberty/ * cp-demangle.c (cplus_demangle_fill_ctor,cplus_demangle_fill_dtor): Handle unified ctor/dtor. (d_ctor_dtor_name): Handle unified ctor/dtor. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@206182 138bc75d-0d04-0410-961f-82ee72b054a4
* Fix demangler to handle conversion operators correctly.ccoutant2013-11-264-36/+202
| | | | | | | | | | | | | | | | | | | | | | | | | | 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
* config/ * picflag.m4 (m68k-*-*): Use default PIC flag.schwab2013-11-212-3/+4
| | | | | | | | | | | | | | | | gcc/ * configure: Regenerate. libada/ * configure: Regenerate. libgcc/ * configure: Regenerate. libiberty/ * configure: Regenerate. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@204854 138bc75d-0d04-0410-961f-82ee72b054a4
* * cp-demangle.c (d_copy_templates): Cast result of malloc to (struct ↵uros2013-11-152-9/+16
| | | | | | d_print_template *). (d_print_comp): Cast result of realloc to (struct d_saved scope *). git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@204713 138bc75d-0d04-0410-961f-82ee72b054a4
* 2013-10-29 Marc Glisse <marc.glisse@inria.fr>glisse2013-11-082-14/+7
| | | | | | | | | | | | | | | | PR tree-optimization/58689 include/ * ansidecl.h (ATTRIBUTE_RETURNS_NONNULL): New macro. * libiberty.h (basename, lbasename, dos_lbasename, unix_lbasename, concat_copy): Mark with attributes nonnull(1) and returns_nonnull. (concat, reconcat, concat_copy2, choose_temp_base, xstrerror, xmalloc, xrealloc, xcalloc, xstrdup, xstrndup, xmemdup, pex_init): Mark with attribute returns_nonnull. libiberty/ * concat.c: Remove note about xmalloc. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@204159 138bc75d-0d04-0410-961f-82ee72b054a4
* * testsuite/test-demangle.c: Include unistd.h.gerald2013-11-082-0/+7
| | | | git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@204107 138bc75d-0d04-0410-961f-82ee72b054a4
* libiberty/ 2013-10-25 Gary Benson <gbenson@redhat.com>gary2013-11-083-2/+149
| | | | | | | | | | | | | | | | | | | * cp-demangle.c (struct d_saved_scope): New structure. (struct d_print_info): New fields saved_scopes and num_saved_scopes. (d_print_init): Initialize the above. (d_print_free): New function. (cplus_demangle_print_callback): Call the above. (d_copy_templates): New function. (d_print_comp): New variables saved_templates and need_template_restore. [DEMANGLE_COMPONENT_REFERENCE, DEMANGLE_COMPONENT_RVALUE_REFERENCE]: Capture scope the first time the component is traversed, and use the captured scope for subsequent traversals. * testsuite/demangle-expected: Add regression test. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@204068 138bc75d-0d04-0410-961f-82ee72b054a4
* * testsuite/test-expandargv.c: Include unistd.h.gerald2013-11-082-0/+7
| | | | git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@203993 138bc75d-0d04-0410-961f-82ee72b054a4
* Fix up ChangeLog entries (name, e-mail, formatting, otherwise).gerald2013-11-081-3/+3
| | | | git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@203992 138bc75d-0d04-0410-961f-82ee72b054a4
* merge from gccDJ Delorie2013-10-165-1/+26
|
* merge from gccDJ Delorie2013-09-121-0/+2
|
* merge from gccDJ Delorie2013-09-103-170/+26
|
* merge from gccDJ Delorie2013-09-103-2/+189
|
* merge from gccDJ Delorie2013-08-202-2/+17
|
* merge from gccDJ Delorie2013-07-221-1/+1
|
* merge from gccDJ Delorie2013-07-211-1/+1
|
* 2013-07-09 Tristan Gingold <gingold@adacore.com>Tristan Gingold2013-07-092-1/+6
| | | | * makefile.vms (OBJS): Add dwarfnames.obj
* merge from gccDJ Delorie2013-06-014-58/+80
|
* merge from gccDJ Delorie2013-05-102-11/+10
|
* merge from gccDJ Delorie2013-04-232-8/+29
|
* merge from gccDJ Delorie2013-04-043-44/+34
|
* merge from gccDJ Delorie2013-04-033-13/+150
|
* merge from gccDJ Delorie2013-03-282-1/+7
|
* merge from gccDJ Delorie2013-03-175-35/+36
|
* Fix compilation warning by MinGW GCC.Eli Zaretskii2013-03-172-0/+8
| | | | | setenv.c [!HAVE_ENVIRON_DECL]: Avoid declaring environ if it is a macro, as this causes compiler warnings with MinGW.
* merge from gccDJ Delorie2013-03-013-3/+11
|
* merge from gccDJ Delorie2013-02-153-1/+28
|
* merge from gccDJ Delorie2013-02-092-4/+12
|
* merge from gccDJ Delorie2013-02-072-3/+6
|
* PR other/543413Kai Tietz2013-01-312-2/+7
| | | | | * md5.c (md5_process_block): Handle case that size_t is a wider-integer-scalar a 32-bit unsigned integer.
* merge from gccDJ Delorie2013-01-076-4/+928
|
* merge from gccDJ Delorie2012-11-113-10/+57
|
* merge from gccDJ Delorie2012-10-1010-24/+187
|
* Replace malloc with xmallocH.J. Lu2012-08-292-38/+16
| | | | | | | * argv.c (dupargv): Replace malloc with xmalloc. Don't check xmalloc return. (buildargv): Likewise. Also replace strdup with xstrdup. (expandargv): Don't check dupargv return.
* Replace alloca with xmalloc/freeH.J. Lu2012-08-292-1/+8
| | | | | PR binutils/14526 * argv.c (buildargv): Replace alloca with xmalloc/free.