gas: avoid octal numbers being accepted when processing .linefile
Compilers would put decimal numbers there, so I think we should treat finding octal numbers the same as finding bignums - ignore them as actually being comments of some very specific form.
This commit is contained in:
parent
9c70556165
commit
85aaf32e61
3 changed files with 12 additions and 0 deletions
|
@ -2047,6 +2047,14 @@ get_linefile_number (int *flag)
|
|||
if (*input_line_pointer < '0' || *input_line_pointer > '9')
|
||||
return false;
|
||||
|
||||
/* Don't mistakenly interpret octal numbers as line numbers. */
|
||||
if (*input_line_pointer == '0')
|
||||
{
|
||||
*flag = 0;
|
||||
++input_line_pointer;
|
||||
return true;
|
||||
}
|
||||
|
||||
expression_and_evaluate (&exp);
|
||||
if (exp.X_op != O_constant)
|
||||
return false;
|
||||
|
|
|
@ -2,4 +2,5 @@
|
|||
.*linefile\.s: Assembler messages:
|
||||
.*linefile\.s:2: Warning: line 2
|
||||
.*linefile\.s:5: Warning: line 5
|
||||
.*linefile\.s:8: Warning: line 8
|
||||
#pass
|
||||
|
|
|
@ -3,3 +3,6 @@
|
|||
|
||||
# 123456789123456789123456789 "LINEfile.s"
|
||||
.warning "line 5"
|
||||
|
||||
# 0123456789 "lineFILE.s"
|
||||
.warning "line 8"
|
||||
|
|
Loading…
Add table
Reference in a new issue