File tree 3 files changed +9
-3
lines changed
3 files changed +9
-3
lines changed Original file line number Diff line number Diff line change @@ -535,7 +535,8 @@ Bug Fixes in This Version
535
535
- Fixed visibility calculation for template functions. (#GH103477)
536
536
- Fixed a bug where an attribute before a ``pragma clang attribute `` or
537
537
``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 ``#include `` directive. (#GH138094)
539
540
540
541
Bug Fixes to Compiler Builtins
541
542
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Original file line number Diff line number Diff line change @@ -220,11 +220,11 @@ void Preprocessor::Handle_Pragma(Token &Tok) {
220
220
if (!tok::isStringLiteral (Tok.getKind ())) {
221
221
Diag (PragmaLoc, diag::err__Pragma_malformed);
222
222
// 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) )
224
224
Lex (Tok);
225
225
while (Tok.isNot (tok::r_paren) &&
226
226
!Tok.isAtStartOfLine () &&
227
- Tok.isNot (tok::eof))
227
+ Tok.isNot (tok::eof) && Tok. isNot (tok::eod) )
228
228
Lex (Tok);
229
229
if (Tok.is (tok::r_paren))
230
230
Lex (Tok);
Original file line number Diff line number Diff line change
1
+ // RUN: %clang_cc1 %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