diff options
author | Ian Lance Taylor <ian@gcc.gnu.org> | 2012-09-19 15:51:16 +0000 |
---|---|---|
committer | Ian Lance Taylor <ian@gcc.gnu.org> | 2012-09-19 15:51:16 +0000 |
commit | 69d4d74dff077c4587c836052c931fc23a6a9679 (patch) | |
tree | 1530ed2de0a22ef1af76227cf5bee910ada88f5f /gcc | |
parent | 17fff17b06f8a9fe4aad1e117cce060be0c6ef61 (diff) | |
download | gcc-69d4d74dff077c4587c836052c931fc23a6a9679.zip gcc-69d4d74dff077c4587c836052c931fc23a6a9679.tar.gz gcc-69d4d74dff077c4587c836052c931fc23a6a9679.tar.bz2 |
compiler: Ignore byte-order-mark at start of file.
From-SVN: r191485
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/go/gofrontend/lex.cc | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/gcc/go/gofrontend/lex.cc b/gcc/go/gofrontend/lex.cc index 42d444b..fa9db1f 100644 --- a/gcc/go/gofrontend/lex.cc +++ b/gcc/go/gofrontend/lex.cc @@ -722,7 +722,16 @@ Lex::next_token() unsigned int ci; bool issued_error; this->lineoff_ = p - this->linebuf_; - this->advance_one_utf8_char(p, &ci, &issued_error); + const char *pnext = this->advance_one_utf8_char(p, &ci, + &issued_error); + + // Ignore byte order mark at start of file. + if (ci == 0xfeff && this->lineno_ == 1 && this->lineoff_ == 0) + { + p = pnext; + break; + } + if (Lex::is_unicode_letter(ci)) return this->gather_identifier(); |