Fix out-of-memory crash when indenting generated tokens.

Generated tokens do not have a position in any source file, so not try
to indent them. Previously, the 'source' used was the scratch buffer,
which would not contain newlines, so the indent depth would be the
length of the scratch buffer at that point.

Task-number: QTCREATORBUG-7262
Change-Id: If94213d6dffd13dd2b47c7038ec2398ad925d904
Reviewed-by: Yuchen Deng <loaden@gmail.com>
Reviewed-by: Thomas Hartmann <Thomas.Hartmann@nokia.com>
This commit is contained in:
Erik Verbruggen
2012-04-22 12:04:00 +02:00
committed by Erik Verbruggen
parent 3f4a9548be
commit bd47622183
3 changed files with 21 additions and 10 deletions

View File

@@ -11,7 +11,7 @@ op_ADD, op_SUB,
static const char *names[] = {
#gen true
# 2 "data/identifier-expansion.3.cpp"
"ADD"
"ADD"
,