projects
/
deliverable
/
binutils-gdb.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Delete temporary string within demangler even in failure cases.
[deliverable/binutils-gdb.git]
/
binutils
/
ieee.c
diff --git
a/binutils/ieee.c
b/binutils/ieee.c
index fd8374b335ddfe07cd42dd79e938437ca7901046..4834047a3e0886c159dad5279682310610214ea9 100644
(file)
--- a/
binutils/ieee.c
+++ b/
binutils/ieee.c
@@
-1,6
+1,5
@@
/* ieee.c -- Read and write IEEE-695 debugging information.
/* ieee.c -- Read and write IEEE-695 debugging information.
- Copyright 1996, 1998, 1999, 2000, 2001, 2002, 2003, 2005, 2006, 2007,
- 2008, 2009 Free Software Foundation, Inc.
+ Copyright (C) 1996-2014 Free Software Foundation, Inc.
Written by Ian Lance Taylor <ian@cygnus.com>.
This file is part of GNU Binutils.
Written by Ian Lance Taylor <ian@cygnus.com>.
This file is part of GNU Binutils.
@@
-2616,7
+2615,7
@@
ieee_read_cxx_class (struct ieee_info *info, const bfd_byte **pp,
case 'b':
{
bfd_vma flags, cinline;
case 'b':
{
bfd_vma flags, cinline;
- const char *base
name
, *fieldname;
+ const char *base, *fieldname;
unsigned long baselen, fieldlen;
char *basecopy;
debug_type basetype;
unsigned long baselen, fieldlen;
char *basecopy;
debug_type basetype;
@@
-2628,7
+2627,7
@@
ieee_read_cxx_class (struct ieee_info *info, const bfd_byte **pp,
/* This represents a base or friend class. */
if (! ieee_require_asn (info, pp, &flags)
/* This represents a base or friend class. */
if (! ieee_require_asn (info, pp, &flags)
- || ! ieee_require_atn65 (info, pp, &base
name
, &baselen)
+ || ! ieee_require_atn65 (info, pp, &base, &baselen)
|| ! ieee_require_asn (info, pp, &cinline)
|| ! ieee_require_atn65 (info, pp, &fieldname, &fieldlen))
return FALSE;
|| ! ieee_require_asn (info, pp, &cinline)
|| ! ieee_require_atn65 (info, pp, &fieldname, &fieldlen))
return FALSE;
@@
-2650,7
+2649,7
@@
ieee_read_cxx_class (struct ieee_info *info, const bfd_byte **pp,
return FALSE;
}
return FALSE;
}
- basecopy = savestring (base
name
, baselen);
+ basecopy = savestring (base, baselen);
basetype = debug_find_tagged_type (dhandle, basecopy,
DEBUG_KIND_ILLEGAL);
free (basecopy);
basetype = debug_find_tagged_type (dhandle, basecopy,
DEBUG_KIND_ILLEGAL);
free (basecopy);
@@
-3113,7
+3112,7
@@
ieee_read_cxx_class (struct ieee_info *info, const bfd_byte **pp,
case 'z':
{
case 'z':
{
- const char *vname, *base
name
;
+ const char *vname, *base;
unsigned long vnamelen, baselen;
bfd_vma vsize, control;
unsigned long vnamelen, baselen;
bfd_vma vsize, control;
@@
-3121,7
+3120,7
@@
ieee_read_cxx_class (struct ieee_info *info, const bfd_byte **pp,
if (! ieee_require_atn65 (info, pp, &vname, &vnamelen)
|| ! ieee_require_asn (info, pp, &vsize)
if (! ieee_require_atn65 (info, pp, &vname, &vnamelen)
|| ! ieee_require_asn (info, pp, &vsize)
- || ! ieee_require_atn65 (info, pp, &base
name
, &baselen)
+ || ! ieee_require_atn65 (info, pp, &base, &baselen)
|| ! ieee_require_asn (info, pp, &control))
return FALSE;
count -= 4;
|| ! ieee_require_asn (info, pp, &control))
return FALSE;
count -= 4;
@@
-3138,7
+3137,7
@@
ieee_read_cxx_class (struct ieee_info *info, const bfd_byte **pp,
{
char *basecopy;
{
char *basecopy;
- basecopy = savestring (base
name
, baselen);
+ basecopy = savestring (base, baselen);
vptrbase = debug_find_tagged_type (dhandle, basecopy,
DEBUG_KIND_ILLEGAL);
free (basecopy);
vptrbase = debug_find_tagged_type (dhandle, basecopy,
DEBUG_KIND_ILLEGAL);
free (basecopy);
@@
-4824,7
+4823,6
@@
ieee_start_compilation_unit (void *p, const char *filename)
const char *backslash;
#endif
char *c, *s;
const char *backslash;
#endif
char *c, *s;
- unsigned int nindx;
if (info->filename != NULL)
{
if (info->filename != NULL)
{
@@
-4872,7
+4870,6
@@
ieee_start_compilation_unit (void *p, const char *filename)
|| ! ieee_write_id (info, info->modname))
return FALSE;
|| ! ieee_write_id (info, info->modname))
return FALSE;
- nindx = info->name_indx;
++info->name_indx;
if (! ieee_change_buffer (info, &info->vars)
|| ! ieee_write_byte (info, (int) ieee_bb_record_enum)
++info->name_indx;
if (! ieee_change_buffer (info, &info->vars)
|| ! ieee_write_byte (info, (int) ieee_bb_record_enum)
@@
-4940,7
+4937,7
@@
ieee_finish_compilation_unit (struct ieee_handle *info)
if (! ieee_change_buffer (info, &info->linenos)
|| ! ieee_write_byte (info, (int) ieee_be_record_enum))
return FALSE;
if (! ieee_change_buffer (info, &info->linenos)
|| ! ieee_write_byte (info, (int) ieee_be_record_enum))
return FALSE;
- if (
str
cmp (info->filename, info->lineno_filename) != 0)
+ if (
filename_
cmp (info->filename, info->lineno_filename) != 0)
{
/* We were not in the main file. We just closed the
included line number block, and now we must close the
{
/* We were not in the main file. We just closed the
included line number block, and now we must close the
@@
-5127,7
+5124,10
@@
ieee_add_bb11 (struct ieee_handle *info, asection *sec, bfd_vma low,
|| ! ieee_write_id (info, "")
|| ! ieee_write_number (info, 0)
|| ! ieee_write_id (info, "GNU objcopy"))
|| ! ieee_write_id (info, "")
|| ! ieee_write_number (info, 0)
|| ! ieee_write_id (info, "GNU objcopy"))
- return FALSE;
+ {
+ free (c);
+ return FALSE;
+ }
free (c);
}
free (c);
}
@@
-5531,7
+5531,10
@@
ieee_function_type (void *p, int argcount, bfd_boolean varargs)
|| ! ieee_write_number (info, 0)
|| ! ieee_write_number (info, retindx)
|| ! ieee_write_number (info, (bfd_vma) argcount + (varargs ? 1 : 0)))
|| ! ieee_write_number (info, 0)
|| ! ieee_write_number (info, retindx)
|| ! ieee_write_number (info, (bfd_vma) argcount + (varargs ? 1 : 0)))
- return FALSE;
+ {
+ free (args);
+ return FALSE;
+ }
if (argcount > 0)
{
for (i = 0; i < argcount; i++)
if (argcount > 0)
{
for (i = 0; i < argcount; i++)
@@
-5688,12
+5691,6
@@
ieee_set_type (void *p, bfd_boolean bitstringp ATTRIBUTE_UNUSED)
static bfd_boolean
ieee_offset_type (void *p)
{
static bfd_boolean
ieee_offset_type (void *p)
{
- struct ieee_handle *info = (struct ieee_handle *) p;
- unsigned int targetindx, baseindx;
-
- targetindx = ieee_pop_type (info);
- baseindx = ieee_pop_type (info);
-
/* FIXME: The MRI C++ compiler does not appear to generate any
useful type information about an offset type. It just records a
pointer to member as an integer. The MRI/HP IEEE spec does
/* FIXME: The MRI C++ compiler does not appear to generate any
useful type information about an offset type. It just records a
pointer to member as an integer. The MRI/HP IEEE spec does
@@
-5980,8
+5977,6
@@
ieee_struct_field (void *p, const char *name, bfd_vma bitpos, bfd_vma bitsize,
if (referencep)
{
if (referencep)
{
- unsigned int nindx;
-
/* We need to output a record recording that this field is
really of reference type. We put this on the refs field
of classdef, so that it can be appended to the C++
/* We need to output a record recording that this field is
really of reference type. We put this on the refs field
of classdef, so that it can be appended to the C++
@@
-6245,7
+6240,10
@@
ieee_class_baseclass (void *p, bfd_vma bitpos, bfd_boolean is_virtual,
|| ! ieee_write_id (info, fname)
|| ! ieee_write_number (info, bindx)
|| ! ieee_write_number (info, bitpos / 8))
|| ! ieee_write_id (info, fname)
|| ! ieee_write_number (info, bindx)
|| ! ieee_write_number (info, bitpos / 8))
- return FALSE;
+ {
+ free (fname);
+ return FALSE;
+ }
flags = 0;
}
flags = 0;
}
@@
-6260,7
+6258,10
@@
ieee_class_baseclass (void *p, bfd_vma bitpos, bfd_boolean is_virtual,
|| ! ieee_write_atn65 (info, nindx, bname)
|| ! ieee_write_asn (info, nindx, 0)
|| ! ieee_write_atn65 (info, nindx, fname))
|| ! ieee_write_atn65 (info, nindx, bname)
|| ! ieee_write_asn (info, nindx, 0)
|| ! ieee_write_atn65 (info, nindx, fname))
- return FALSE;
+ {
+ free (fname);
+ return FALSE;
+ }
info->type_stack->type.classdef->pmisccount += 5;
free (fname);
info->type_stack->type.classdef->pmisccount += 5;
free (fname);
@@
-7349,15
+7350,17
@@
ieee_lineno (void *p, const char *filename, unsigned long lineno, bfd_vma addr)
info->lineno_filename = info->filename;
}
info->lineno_filename = info->filename;
}
- if (strcmp (info->pending_lineno_filename, info->lineno_filename) != 0)
+ if (filename_cmp (info->pending_lineno_filename,
+ info->lineno_filename) != 0)
{
{
- if (
str
cmp (info->filename, info->lineno_filename) != 0)
+ if (
filename_
cmp (info->filename, info->lineno_filename) != 0)
{
/* We were not in the main file. Close the block for the
included file. */
if (! ieee_write_byte (info, (int) ieee_be_record_enum))
return FALSE;
{
/* We were not in the main file. Close the block for the
included file. */
if (! ieee_write_byte (info, (int) ieee_be_record_enum))
return FALSE;
- if (strcmp (info->filename, info->pending_lineno_filename) == 0)
+ if (filename_cmp (info->filename,
+ info->pending_lineno_filename) == 0)
{
/* We need a new NN record, and we aren't about to
output one. */
{
/* We need a new NN record, and we aren't about to
output one. */
@@
-7369,7
+7372,8
@@
ieee_lineno (void *p, const char *filename, unsigned long lineno, bfd_vma addr)
return FALSE;
}
}
return FALSE;
}
}
- if (strcmp (info->filename, info->pending_lineno_filename) != 0)
+ if (filename_cmp (info->filename,
+ info->pending_lineno_filename) != 0)
{
/* We are not changing to the main file. Open a block for
the new included file. */
{
/* We are not changing to the main file. Open a block for
the new included file. */
This page took
0.02745 seconds
and
4
git commands to generate.