File tree Expand file tree Collapse file tree 3 files changed +10
-3
lines changed Expand file tree Collapse file tree 3 files changed +10
-3
lines changed Original file line number Diff line number Diff line change @@ -535,7 +535,9 @@ Bug Fixes in This Version
535535- Fixed visibility calculation for template functions. (#GH103477)
536536- Fixed a bug where an attribute before a ``pragma clang attribute `` or
537537 ``pragma clang __debug `` would cause an assertion. Instead, this now diagnoses
538- the invalid attribute location appropriately. (#GH137861)
538+ the invalid attribute location appropriately. (#GH137861)
539+ - Fixed a crash when a malformed ``_Pragma `` directive appears as part of an
540+ ``#include `` directive. (#GH138094)
539541
540542Bug Fixes to Compiler Builtins
541543^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Original file line number Diff line number Diff line change @@ -220,11 +220,11 @@ void Preprocessor::Handle_Pragma(Token &Tok) {
220220 if (!tok::isStringLiteral (Tok.getKind ())) {
221221 Diag (PragmaLoc, diag::err__Pragma_malformed);
222222 // Skip bad tokens, and the ')', if present.
223- if (Tok.isNot (tok::r_paren) && Tok.isNot (tok::eof))
223+ if (Tok.isNot (tok::r_paren) && Tok.isNot (tok::eof) && Tok. isNot (tok::eod) )
224224 Lex (Tok);
225225 while (Tok.isNot (tok::r_paren) &&
226226 !Tok.isAtStartOfLine () &&
227- Tok.isNot (tok::eof))
227+ Tok.isNot (tok::eof) && Tok. isNot (tok::eod) )
228228 Lex (Tok);
229229 if (Tok.is (tok::r_paren))
230230 Lex (Tok);
Original file line number Diff line number Diff line change 1+ // RUN: %clang_cc1 -E %s -verify
2+
3+ // Don't crash, verify that diagnostics are preserved
4+ #include _Pragma ( // expected-error {{_Pragma takes a parenthesized string literal}} \
5+ expected-error {{expected "FILENAME"}}
You can’t perform that action at this time.
0 commit comments