Fixed possible crash in the preprocessing phase when the first token in the

`original' (not preprocessed) token stream has the whitespace atttribute on.
This commit is contained in:
Roberto Raggi
2009-07-01 10:49:27 +02:00
parent f8531cc833
commit ed2eb296b1

View File

@@ -771,7 +771,11 @@ void Preprocessor::preprocess(const QString &fileName, const QByteArray &source,
} else {
if (_dot->whitespace) {
const unsigned endOfPreviousToken = (_dot - 1)->end();
unsigned endOfPreviousToken = 0;
if (_dot != _tokens.constBegin())
endOfPreviousToken = (_dot - 1)->end();
const unsigned beginOfToken = _dot->begin();
const char *start = _source.constBegin() + endOfPreviousToken;