Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
R
riscv-gcc-1
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
lvzhengyang
riscv-gcc-1
Commits
e169e8b0
Commit
e169e8b0
authored
Oct 11, 2013
by
Ian Lance Taylor
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
compiler: Improve handling of invalid ASCII characters in identifiers.
From-SVN: r203450
parent
20e8fa53
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
22 additions
and
1 deletions
+22
-1
gcc/go/gofrontend/lex.cc
+22
-1
No files found.
gcc/go/gofrontend/lex.cc
View file @
e169e8b0
...
...
@@ -873,7 +873,28 @@ Lex::gather_identifier()
&&
(
cc
<
'a'
||
cc
>
'z'
)
&&
cc
!=
'_'
&&
(
cc
<
'0'
||
cc
>
'9'
))
break
;
{
// Check for an invalid character here, as we get better
// error behaviour if we swallow them as part of the
// identifier we are building.
if
((
cc
>=
' '
&&
cc
<
0x7f
)
||
cc
==
'\t'
||
cc
==
'\r'
||
cc
==
'\n'
)
break
;
this
->
lineoff_
=
p
-
this
->
linebuf_
;
error_at
(
this
->
location
(),
"invalid character 0x%x in identifier"
,
cc
);
if
(
!
has_non_ascii_char
)
{
buf
.
assign
(
pstart
,
p
-
pstart
);
has_non_ascii_char
=
true
;
}
if
(
!
Lex
::
is_invalid_identifier
(
buf
))
buf
.
append
(
"$INVALID$"
);
}
++
p
;
if
(
is_first
)
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment