diff options
author | Roberto Raggi <roberto.raggi@nokia.com> | 2009-10-28 13:48:32 (GMT) |
---|---|---|
committer | Roberto Raggi <roberto.raggi@nokia.com> | 2009-10-28 13:48:32 (GMT) |
commit | 88632908b8923e626f36b6132ac179553d39c333 (patch) | |
tree | cc3bd71976dfe0a266ac7c0d987a1918178deb87 /src/declarative | |
parent | 13751c0fd2eacea6447766033c22dbe3dd0369d7 (diff) | |
download | Qt-88632908b8923e626f36b6132ac179553d39c333.zip Qt-88632908b8923e626f36b6132ac179553d39c333.tar.gz Qt-88632908b8923e626f36b6132ac179553d39c333.tar.bz2 |
Fixed possible crash when inserting semicolon.
Don't insert T_SEMICOLON when yytoken == -1
Done-with: joerg
Diffstat (limited to 'src/declarative')
-rw-r--r-- | src/declarative/qml/parser/qmljs.g | 2 | ||||
-rw-r--r-- | src/declarative/qml/parser/qmljsgrammar.cpp | 2 | ||||
-rw-r--r-- | src/declarative/qml/parser/qmljsgrammar_p.h | 2 | ||||
-rw-r--r-- | src/declarative/qml/parser/qmljsparser.cpp | 2 |
4 files changed, 4 insertions, 4 deletions
diff --git a/src/declarative/qml/parser/qmljs.g b/src/declarative/qml/parser/qmljs.g index eb9a8ab..c5b2764 100644 --- a/src/declarative/qml/parser/qmljs.g +++ b/src/declarative/qml/parser/qmljs.g @@ -2949,7 +2949,7 @@ PropertyNameAndValueListOpt: PropertyNameAndValueList ; const int errorState = state_stack[tos]; // automatic insertion of `;' - if (t_action(errorState, T_AUTOMATIC_SEMICOLON) && automatic(driver, yytoken)) { + if (yytoken != -1 && t_action(errorState, T_AUTOMATIC_SEMICOLON) && automatic(driver, yytoken)) { SavedToken &tk = token_buffer[0]; tk.token = yytoken; tk.dval = yylval; diff --git a/src/declarative/qml/parser/qmljsgrammar.cpp b/src/declarative/qml/parser/qmljsgrammar.cpp index da3ce2a..2b92b82 100644 --- a/src/declarative/qml/parser/qmljsgrammar.cpp +++ b/src/declarative/qml/parser/qmljsgrammar.cpp @@ -4,7 +4,7 @@ ** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). ** Contact: Qt Software Information (qt-info@nokia.com) ** -** This file is part of the QtCore module of the Qt Toolkit. +** This file is part of the QtDeclarative module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** No Commercial Usage diff --git a/src/declarative/qml/parser/qmljsgrammar_p.h b/src/declarative/qml/parser/qmljsgrammar_p.h index b297f81..20d7188 100644 --- a/src/declarative/qml/parser/qmljsgrammar_p.h +++ b/src/declarative/qml/parser/qmljsgrammar_p.h @@ -4,7 +4,7 @@ ** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). ** Contact: Qt Software Information (qt-info@nokia.com) ** -** This file is part of the QtCore module of the Qt Toolkit. +** This file is part of the QtDeclarative module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** No Commercial Usage diff --git a/src/declarative/qml/parser/qmljsparser.cpp b/src/declarative/qml/parser/qmljsparser.cpp index 402aaeb..dd2553f 100644 --- a/src/declarative/qml/parser/qmljsparser.cpp +++ b/src/declarative/qml/parser/qmljsparser.cpp @@ -1713,7 +1713,7 @@ case 337: { const int errorState = state_stack[tos]; // automatic insertion of `;' - if (t_action(errorState, T_AUTOMATIC_SEMICOLON) && automatic(driver, yytoken)) { + if (yytoken != -1 && t_action(errorState, T_AUTOMATIC_SEMICOLON) && automatic(driver, yytoken)) { SavedToken &tk = token_buffer[0]; tk.token = yytoken; tk.dval = yylval; |