Browse Source

Fix for "vector subscript out of range" exception (#1621)

- The Visual Studio C++ compiler does not allow to access Headers[i+1]
when i+1 points past the last element.
Doing so raises an exception when in
debug mode

Co-authored-by: Christian Kolek <Christian.Kolek@teamviewer.com>
llvm-debug
strentler 4 years ago committed by GitHub
parent
commit
f3fa7eb9ef
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 2
      src/CppParser/Parser.cpp

2
src/CppParser/Parser.cpp

@ -4640,7 +4640,7 @@ ParserResult* ClangParser::ParseHeader(CppParserOptions* Opts) @@ -4640,7 +4640,7 @@ ParserResult* ClangParser::ParseHeader(CppParserOptions* Opts)
{
auto parser = new Parser(Opts);
parsers.push_back(parser);
std::vector<std::string> Header(&Headers[i], &Headers[i + 1]);
std::vector<std::string> Header{Headers[i]};
if (i < Headers.size() - 1)
delete parser->Parse(Header);
else

Loading…
Cancel
Save