Skip to content

Commit f47939a

Browse files
Update simplecpp.cpp
1 parent 1355610 commit f47939a

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

simplecpp.cpp

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3602,9 +3602,11 @@ void simplecpp::preprocess(simplecpp::TokenList &output, const simplecpp::TokenL
36023602
header = tok->str().substr(1U, tok->str().size() - 2U);
36033603
closingAngularBracket = true;
36043604
}
3605-
std::ifstream f;
3606-
const std::string header2 = openHeader(f,dui,sourcefile,header,systemheader);
3607-
expr.push_back(new Token(header2.empty() ? "0" : "1", tok->location));
3605+
if (tok) {
3606+
std::ifstream f;
3607+
const std::string header2 = openHeader(f,dui,sourcefile,header,systemheader);
3608+
expr.push_back(new Token(header2.empty() ? "0" : "1", tok->location));
3609+
}
36083610
}
36093611
if (par)
36103612
tok = tok ? tok->next : nullptr;

0 commit comments

Comments
 (0)