diff options
author | Chuanqi Xu <yedeng.yd@linux.alibaba.com> | 2023-04-27 14:19:32 +0800 |
---|---|---|
committer | Chuanqi Xu <yedeng.yd@linux.alibaba.com> | 2023-04-27 14:20:59 +0800 |
commit | aba32abe2d93133a46f67764937a1c85d455dce8 (patch) | |
tree | c9a4cd9bcee31dca7c343b3d4cf652e3e315f722 /clang/lib/Lex/Lexer.cpp | |
parent | f88f8fd0bca34dc8e5571cb828b1a159a50fd504 (diff) | |
download | llvm-aba32abe2d93133a46f67764937a1c85d455dce8.zip llvm-aba32abe2d93133a46f67764937a1c85d455dce8.tar.gz llvm-aba32abe2d93133a46f67764937a1c85d455dce8.tar.bz2 |
[C++20] [Modules] Avoid crash if the inconsistency the size of lang options exceeds 1
Close https://github.com/llvm/llvm-project/issues/62359
The root reason for the crash is that we didn't test the case that
the bits number of a language option exceeds 1.
Diffstat (limited to 'clang/lib/Lex/Lexer.cpp')
-rw-r--r-- | clang/lib/Lex/Lexer.cpp | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/clang/lib/Lex/Lexer.cpp b/clang/lib/Lex/Lexer.cpp index bc97ca1..53cd43d 100644 --- a/clang/lib/Lex/Lexer.cpp +++ b/clang/lib/Lex/Lexer.cpp @@ -4361,11 +4361,9 @@ HandleDirective: FormTokenWithChars(Result, CurPtr, tok::hash); PP->HandleDirective(Result); - if (PP->hadModuleLoaderFatalFailure()) { + if (PP->hadModuleLoaderFatalFailure()) // With a fatal failure in the module loader, we abort parsing. - assert(Result.is(tok::eof) && "Preprocessor did not set tok:eof"); return true; - } // We parsed the directive; lex a token with the new state. return false; |