/* stabs.c -- Parse stabs debugging information
- Copyright (C) 1995-2015 Free Software Foundation, Inc.
+ Copyright (C) 1995-2017 Free Software Foundation, Inc.
Written by Ian Lance Taylor <ian@cygnus.com>.
This file is part of GNU Binutils.
orig = *pp;
+ /* Stop early if we are passed an empty string. */
+ if (*orig == 0)
+ return (bfd_vma) 0;
+
errno = 0;
ul = strtoul (*pp, (char **) pp, 0);
if (ul + 1 != 0 || errno == 0)
else if (n3 == (bfd_signed_vma) 0xffffffff)
return debug_make_int_type (dhandle, 4, TRUE);
#ifdef BFD64
- else if (n3 == ((((bfd_signed_vma) 0xffffffff) << 32) | 0xffffffff))
+ else if (n3 == (bfd_signed_vma) 0xffffffffffffffffLL)
return debug_make_int_type (dhandle, 8, TRUE);
#endif
}
bfd_signed_vma val;
p = *pp;
- while (*p != ':')
+ while (*p != ':' && *p != 0)
++p;
+ if (*p == 0)
+ {
+ bad_stab (orig);
+ free (names);
+ free (values);
+ return DEBUG_TYPE_NULL;
+ }
+
name = savestring (*pp, p - *pp);
*pp = p + 1;
case '*':
/* virtual member function, followed by index. The sign
bit is supposedly set to distinguish
- pointers-to-methods from virtual function indicies. */
+ pointers-to-methods from virtual function indices. */
++*pp;
voffset = parse_number (pp, (bfd_boolean *) NULL);
if (**pp != ';')
++*pp;
voffset &= 0x7fffffff;
- if (**pp == ';' || *pp == '\0')
+ if (**pp == ';' || **pp == '\0')
{
/* Must be g++ version 1. */
context = DEBUG_TYPE_NULL;
case 9:
name = "unsigned";
rettype = debug_make_int_type (dhandle, 4, TRUE);
+ break;
case 10:
name = "unsigned long";
rettype = debug_make_int_type (dhandle, 4, TRUE);
context for a function with no arguments. */
if (dc->u.s_binary.left == NULL)
break;
-
+
arg = stab_demangle_v3_arg (dhandle, info, dc->u.s_binary.left,
NULL, &varargs);
if (arg == NULL)