struct conditional_frame cframe;
s1 = demand_copy_C_string (&len1);
+ if (s1 == NULL)
+ {
+ ignore_rest_of_line ();
+ return;
+ }
SKIP_WHITESPACE ();
if (*input_line_pointer != ',')
++input_line_pointer;
s2 = demand_copy_C_string (&len2);
+ if (s2 == NULL)
+ {
+ ignore_rest_of_line ();
+ return;
+ }
res = len1 == len2 && strncmp (s1, s2, len1) == 0;
s_alpha_file (int ignore ATTRIBUTE_UNUSED)
{
symbolS *s;
+ char *name;
int length;
static char case_hack[32];
symbol_get_bfdsym (s)->flags |= BSF_FILE;
get_absolute_expression ();
- s = symbol_find_or_make (demand_copy_string (&length));
+ name = demand_copy_string (&length);
+ if (name == NULL)
+ {
+ ignore_rest_of_line ();
+ return;
+ }
+ s = symbol_find_or_make (name);
symbol_get_bfdsym (s)->flags |= BSF_FILE;
demand_empty_rest_of_line ();
}
{
int len;
char *form = demand_copy_C_string (&len);
+ if (form == NULL)
+ {
+ ignore_rest_of_line ();
+ return;
+ }
if (strcmp (form, "mutex") == 0)
type = 'm';
}
++input_line_pointer;
- symbol_get_tc (sym)->real_name = demand_copy_C_string (&len);
+ name = demand_copy_C_string (&len);
+ if (name == NULL)
+ {
+ ignore_rest_of_line ();
+ return;
+ }
+ symbol_get_tc (sym)->real_name = name;
demand_empty_rest_of_line ();
}
expressionS exp;
name = demand_copy_C_string (&len);
+ if (name == NULL)
+ {
+ ignore_rest_of_line ();
+ return;
+ }
if (*input_line_pointer != ',')
{
{
char *sfname, *s1 = NULL, *s2 = NULL, *s3 = NULL;
int length, auxnb = 1;
+ coff_symbol_type *coffsym;
/* Some assemblers tolerate immediately following '"'. */
- if ((sfname = demand_copy_string (&length)) != 0)
+ sfname = demand_copy_string (&length);
+ if (sfname == NULL)
+ {
+ ignore_rest_of_line ();
+ return;
+ }
+
+ if (*input_line_pointer == ',')
{
- coff_symbol_type *coffsym;
+ ++input_line_pointer;
+ s1 = demand_copy_string (&length);
+ if (s1 == NULL)
+ {
+ ignore_rest_of_line ();
+ return;
+ }
+ auxnb++;
+
if (*input_line_pointer == ',')
{
++input_line_pointer;
- s1 = demand_copy_string (&length);
+ s2 = demand_copy_string (&length);
+ if (s2 == NULL)
+ {
+ ignore_rest_of_line ();
+ return;
+ }
auxnb++;
if (*input_line_pointer == ',')
{
++input_line_pointer;
- s2 = demand_copy_string (&length);
- auxnb++;
-
- if (*input_line_pointer == ',')
+ s3 = demand_copy_string (&length);
+ if (s3 == NULL)
{
- ++input_line_pointer;
- s3 = demand_copy_string (&length);
- auxnb++;
+ ignore_rest_of_line ();
+ return;
}
+ auxnb++;
}
}
+ }
- /* Use coff dot_file creation and adjust auxiliary entries. */
- c_dot_file_symbol (sfname);
- S_SET_NUMBER_AUXILIARY (symbol_rootP, auxnb);
- coffsym = coffsymbol (symbol_get_bfdsym (symbol_rootP));
- coffsym->native[1].u.auxent.x_file.x_ftype = XFT_FN;
-
- if (s1)
- {
- coffsym->native[2].u.auxent.x_file.x_ftype = XFT_CT;
- coffsym->native[2].extrap = s1;
- }
- if (s2)
- {
- coffsym->native[3].u.auxent.x_file.x_ftype = XFT_CV;
- coffsym->native[3].extrap = s2;
- }
- if (s3)
- {
- coffsym->native[4].u.auxent.x_file.x_ftype = XFT_CD;
- coffsym->native[4].extrap = s3;
- }
+ /* Use coff dot_file creation and adjust auxiliary entries. */
+ c_dot_file_symbol (sfname);
+ S_SET_NUMBER_AUXILIARY (symbol_rootP, auxnb);
+ coffsym = coffsymbol (symbol_get_bfdsym (symbol_rootP));
+ coffsym->native[1].u.auxent.x_file.x_ftype = XFT_FN;
- demand_empty_rest_of_line ();
+ if (s1)
+ {
+ coffsym->native[2].u.auxent.x_file.x_ftype = XFT_CT;
+ coffsym->native[2].extrap = s1;
+ }
+ if (s2)
+ {
+ coffsym->native[3].u.auxent.x_file.x_ftype = XFT_CV;
+ coffsym->native[3].extrap = s2;
+ }
+ if (s3)
+ {
+ coffsym->native[4].u.auxent.x_file.x_ftype = XFT_CD;
+ coffsym->native[4].extrap = s3;
}
+
+ demand_empty_rest_of_line ();
}
/* The .function pseudo-op. This takes several arguments. The first
symbolS *look;
name = demand_copy_C_string (&len);
+ if (name == NULL)
+ {
+ ignore_rest_of_line ();
+ return;
+ }
/* The value of these symbols is actually file offset. Here we set
the value to the index into the line number entries. In
symbolS *sym;
name = demand_copy_C_string (&len);
+ if (name == NULL)
+ {
+ ignore_rest_of_line ();
+ return;
+ }
+
sym = symbol_make (name);
S_SET_SEGMENT (sym, ppc_coff_debug_section);
symbol_get_bfdsym (sym)->flags |= BSF_DEBUGGING;
{
int len;
str = demand_copy_C_string (&len);
+ if (str == NULL)
+ {
+ ignore_rest_of_line ();
+ return;
+ }
c = *input_line_pointer;
}
else
if (*input_line_pointer == '"')
{
name = demand_copy_C_string (&len);
+ if (name == NULL)
+ {
+ ignore_rest_of_line ();
+ return;
+ }
demand_empty_rest_of_line ();
name = concat (name, flags, (char *) NULL);
}
if (*input_line_pointer == '"')
{
filename = demand_copy_C_string (&len);
+ if (filename == NULL)
+ {
+ ignore_rest_of_line ();
+ return;
+ }
demand_empty_rest_of_line ();
}
else
ILLEGAL_WITHIN_STRUCT ();
if (*input_line_pointer == '"')
- msg = demand_copy_C_string (&len);
+ {
+ msg = demand_copy_C_string (&len);
+ if (msg == NULL)
+ {
+ ignore_rest_of_line ();
+ return;
+ }
+ }
else
{
msg = input_line_pointer;
int len;
name = demand_copy_C_string (&len);
+ if (name == NULL)
+ {
+ ignore_rest_of_line ();
+ return;
+ }
}
else
{
if (*input_line_pointer == '"')
{
if ((filename = demand_copy_C_string (&len)) == NULL)
- return;
+ {
+ ignore_rest_of_line ();
+ return;
+ }
}
else
{
input_line_pointer = ptr;
*str = demand_copy_C_string (&len);
+ if (*str == NULL)
+ ignore_rest_of_line ();
endp = input_line_pointer;
input_line_pointer = savedp;
/* Do forced substitutions if requested. */
- if (!nosub && **str == ':')
+ if (!nosub && *str && **str == ':')
*str = subsym_substitute (*str, 1);
}
else
filename = demand_copy_C_string (&filename_len);
if (filename == NULL)
- /* demand_copy_C_string will have already generated an error message. */
- return NULL;
+ {
+ /* demand_copy_C_string will have already generated an error. */
+ ignore_rest_of_line ();
+ return NULL;
+ }
/* For DWARF-5 support we also accept:
.file <NUM> ["<dir>"] "<file>" [md5 <NUM>] */
dirname = filename;
filename = demand_copy_C_string (&filename_len);
if (filename == NULL)
- return NULL;
+ {
+ ignore_rest_of_line ();
+ return NULL;
+ }
SKIP_WHITESPACE ();
}
/* FIXME: we don't have to save the name here. */
name = demand_copy_C_string (&len);
+ if (name == NULL)
+ {
+ ignore_rest_of_line ();
+ return;
+ }
add_file (name, indx - 1, 0);
demand_empty_rest_of_line ();
s_file_string (s);
}
+ else
+ ignore_rest_of_line ();
}
static bool
}
if (linenum < 0)
- /* Some of the back ends can't deal with non-positive line numbers.
- Besides, it's silly. GCC however will generate a line number of
- zero when it is pre-processing builtins for assembler-with-cpp files:
+ {
+ /* Some of the back ends can't deal with non-positive line numbers.
+ Besides, it's silly. GCC however will generate a line number of
+ zero when it is pre-processing builtins for assembler-with-cpp files:
- # 0 "<built-in>"
+ # 0 "<built-in>"
- We do not want to barf on this, especially since such files are used
- in the GCC and GDB testsuites. So we check for negative line numbers
- rather than non-positive line numbers. */
- as_warn (_("line numbers must be positive; line number %d rejected"),
- linenum);
- else
- {
- int length = 0;
+ We do not want to barf on this, especially since such files are used
+ in the GCC and GDB testsuites. So we check for negative line numbers
+ rather than non-positive line numbers. */
+ as_warn (_("line numbers must be positive; line number %d rejected"),
+ linenum);
+ ignore_rest_of_line ();
+ return;
+ }
- SKIP_WHITESPACE ();
+ SKIP_WHITESPACE ();
- if (*input_line_pointer == '"')
- file = demand_copy_string (&length);
- else if (*input_line_pointer == '.')
+ if (*input_line_pointer == '"')
+ {
+ int this_flag;
+ int length = 0;
+ file = demand_copy_string (&length);
+ if (file == NULL)
{
- /* buffer_and_nest() may insert this form. */
- ++input_line_pointer;
- flags = 1 << 3;
+ ignore_rest_of_line ();
+ return;
}
- if (file)
- {
- int this_flag;
-
- while (get_linefile_number (&this_flag))
- switch (this_flag)
- {
- /* From GCC's cpp documentation:
- 1: start of a new file.
- 2: returning to a file after having included another file.
- 3: following text comes from a system header file.
- 4: following text should be treated as extern "C".
-
- 4 is nonsensical for the assembler; 3, we don't care about,
- so we ignore it just in case a system header file is
- included while preprocessing assembly. So 1 and 2 are all
- we care about, and they are mutually incompatible.
- new_logical_line_flags() demands this. */
- case 1:
- case 2:
- if (flags && flags != (1 << this_flag))
- as_warn (_("incompatible flag %i in line directive"),
- this_flag);
- else
- flags |= 1 << this_flag;
- break;
+ while (get_linefile_number (&this_flag))
+ switch (this_flag)
+ {
+ /* From GCC's cpp documentation:
+ 1: start of a new file.
+ 2: returning to a file after having included another file.
+ 3: following text comes from a system header file.
+ 4: following text should be treated as extern "C".
+
+ 4 is nonsensical for the assembler; 3, we don't care about,
+ so we ignore it just in case a system header file is
+ included while preprocessing assembly. So 1 and 2 are all
+ we care about, and they are mutually incompatible.
+ new_logical_line_flags() demands this. */
+ case 1:
+ case 2:
+ if (flags && flags != (1 << this_flag))
+ as_warn (_("incompatible flag %i in line directive"),
+ this_flag);
+ else
+ flags |= 1 << this_flag;
+ break;
- case 3:
- case 4:
- /* We ignore these. */
- break;
+ case 3:
+ case 4:
+ /* We ignore these. */
+ break;
- default:
- as_warn (_("unsupported flag %i in line directive"),
- this_flag);
- break;
- }
+ default:
+ as_warn (_("unsupported flag %i in line directive"),
+ this_flag);
+ break;
+ }
- if (!is_end_of_stmt (*input_line_pointer))
- file = NULL;
- }
+ if (!is_end_of_stmt (*input_line_pointer))
+ file = NULL;
+ }
+ else if (*input_line_pointer == '.')
+ {
+ /* buffer_and_nest() may insert this form. */
+ ++input_line_pointer;
+ flags = 1 << 3;
+ }
- if (file || flags)
- {
- demand_empty_rest_of_line ();
+ if (file || flags)
+ {
+ demand_empty_rest_of_line ();
- /* read_a_source_file() will bump the line number only if the line
- is terminated by '\n'. */
- if (input_line_pointer[-1] == '\n')
- linenum--;
+ /* read_a_source_file() will bump the line number only if the line
+ is terminated by '\n'. */
+ if (input_line_pointer[-1] == '\n')
+ linenum--;
- new_logical_line_flags (file, linenum, flags);
+ new_logical_line_flags (file, linenum, flags);
#ifdef LISTING
- if (listing)
- listing_source_line (linenum);
+ if (listing)
+ listing_source_line (linenum);
#endif
- return;
- }
+ return;
}
ignore_rest_of_line ();
}
msg = demand_copy_C_string (&len);
if (msg == NULL)
- return;
+ {
+ ignore_rest_of_line ();
+ return;
+ }
}
if (err)
int len;
s = demand_copy_C_string (&len);
- if (s != NULL)
- printf ("%s\n", s);
+ if (s == NULL)
+ {
+ ignore_rest_of_line ();
+ return;
+ }
+ printf ("%s\n", s);
demand_empty_rest_of_line ();
}
{
if (s[len - 1] == 0)
{
- s = 0;
- *len_pointer = 0;
+ s = NULL;
as_bad (_("this string may not contain \'\\0\'"));
break;
}
{
as_bad (_("missing string"));
retval = NULL;
- ignore_rest_of_line ();
}
*lenP = len;
return retval;
SKIP_WHITESPACE ();
filename = demand_copy_string (& len);
if (filename == NULL)
- return;
+ {
+ ignore_rest_of_line ();
+ return;
+ }
SKIP_WHITESPACE ();
filename = demand_copy_string (&i);
if (filename == NULL)
{
- /* demand_copy_string has already printed an error and
- called ignore_rest_of_line. */
+ /* demand_copy_string has already printed an error. */
+ ignore_rest_of_line ();
return;
}
}
string = demand_copy_C_string (&length);
if (string == NULL)
- goto out2;
+ {
+ ignore_rest_of_line ();
+ goto out2;
+ }
/* FIXME: We should probably find some other temporary storage
for string, rather than leaking memory if someone else
happens to use the notes obstack. */
stab_secname = demand_copy_C_string (&length);
if (stab_secname == NULL)
- /* as_bad error has been reported. */
- return;
+ {
+ ignore_rest_of_line ();
+ return;
+ }
SKIP_WHITESPACE ();
if (*input_line_pointer == ',')
{