mirror of
https://github.com/intel/llvm.git
synced 2026-02-03 10:39:35 +08:00
Fix r173881 to properly skip invalid UTF-8 characters in raw lexing and -E.
This caused hangs as we processed the same invalid byte over and over. <rdar://problem/13115651> llvm-svn: 173959
This commit is contained in:
@@ -3538,6 +3538,7 @@ LexNextToken:
|
||||
return LexUnicode(Result, CodePoint, CurPtr);
|
||||
|
||||
if (isLexingRawMode() || PP->isPreprocessedOutput()) {
|
||||
++CurPtr;
|
||||
Kind = tok::unknown;
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -1,6 +1,12 @@
|
||||
// RUN: %clang_cc1 -fsyntax-only -verify %s
|
||||
// RUN: %clang_cc1 -E %s -o /dev/null
|
||||
|
||||
// Note: this file contains invalid UTF-8 before the variable name in the
|
||||
// next line. Please do not fix!
|
||||
|
||||
extern int ‚x; // expected-error{{source file is not valid UTF-8}}
|
||||
|
||||
#if 0
|
||||
// Don't warn about bad UTF-8 in raw lexing mode.
|
||||
extern int ‚x;
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user