aboutsummaryrefslogtreecommitdiff
path: root/lib/Lex/Pragma.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'lib/Lex/Pragma.cpp')
-rw-r--r--lib/Lex/Pragma.cpp18
1 files changed, 12 insertions, 6 deletions
diff --git a/lib/Lex/Pragma.cpp b/lib/Lex/Pragma.cpp
index cc224dd8d9..dd5f144e34 100644
--- a/lib/Lex/Pragma.cpp
+++ b/lib/Lex/Pragma.cpp
@@ -102,13 +102,17 @@ void Preprocessor::Handle_Pragma(Token &Tok) {
// Read the '('.
Lex(Tok);
- if (Tok.isNot(tok::l_paren))
- return Diag(PragmaLoc, diag::err__Pragma_malformed);
+ if (Tok.isNot(tok::l_paren)) {
+ Diag(PragmaLoc, diag::err__Pragma_malformed);
+ return;
+ }
// Read the '"..."'.
Lex(Tok);
- if (Tok.isNot(tok::string_literal) && Tok.isNot(tok::wide_string_literal))
- return Diag(PragmaLoc, diag::err__Pragma_malformed);
+ if (Tok.isNot(tok::string_literal) && Tok.isNot(tok::wide_string_literal)) {
+ Diag(PragmaLoc, diag::err__Pragma_malformed);
+ return;
+ }
// Remember the string.
std::string StrVal = getSpelling(Tok);
@@ -116,8 +120,10 @@ void Preprocessor::Handle_Pragma(Token &Tok) {
// Read the ')'.
Lex(Tok);
- if (Tok.isNot(tok::r_paren))
- return Diag(PragmaLoc, diag::err__Pragma_malformed);
+ if (Tok.isNot(tok::r_paren)) {
+ Diag(PragmaLoc, diag::err__Pragma_malformed);
+ return;
+ }
// The _Pragma is lexically sound. Destringize according to C99 6.10.9.1.
if (StrVal[0] == 'L') // Remove L prefix.