diff options
author | Neil Hodgson <nyamatongwe@gmail.com> | 2014-06-19 11:48:18 +1000 |
---|---|---|
committer | Neil Hodgson <nyamatongwe@gmail.com> | 2014-06-19 11:48:18 +1000 |
commit | acb58bcf806390865f1a30ff14038e6f4bb62aa9 (patch) | |
tree | fe14a1ec231714fff9a0da5f7f7dc253c3d448bd /lexers/LexCPP.cxx | |
parent | e49fb9d25f14b03400baba0f000a3312ee4a4b25 (diff) | |
download | scintilla-mirror-acb58bcf806390865f1a30ff14038e6f4bb62aa9.tar.gz |
Bug [#1614]. Don't crash on incomplete macro definition "#define x(".
Diffstat (limited to 'lexers/LexCPP.cxx')
-rw-r--r-- | lexers/LexCPP.cxx | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/lexers/LexCPP.cxx b/lexers/LexCPP.cxx index b7ff1859b..5485bf228 100644 --- a/lexers/LexCPP.cxx +++ b/lexers/LexCPP.cxx @@ -1220,7 +1220,9 @@ void SCI_METHOD LexerCPP::Lex(unsigned int startPos, int length, int initStyle, size_t startValue = endArgs+1; while ((startValue < restOfLine.length()) && IsSpaceOrTab(restOfLine[startValue])) startValue++; - std::string value = restOfLine.substr(startValue); + std::string value; + if (startValue < restOfLine.length()) + value = restOfLine.substr(startValue); preprocessorDefinitions[key] = SymbolValue(value, args); ppDefineHistory.push_back(PPDefinition(lineCurrent, key, value, false, args)); definitionsChanged = true; |