Fix visit of list-like AST nodes.
authorRoberto Raggi <roberto.raggi@nokia.com>
Mon, 1 Aug 2011 16:04:30 +0000 (18:04 +0200)
committerQt by Nokia <qt-info@nokia.com>
Tue, 30 Aug 2011 11:18:28 +0000 (13:18 +0200)
The method finish() of a list-like node will convert the circular
list to a single-list. The right way to iterate is by looking
at the member `next' and by invokign finish().

Change-Id: I85a45b691a6c7089cd1a765871a11a7c60c3cdff
Reviewed-on: http://codereview.qt.nokia.com/3780
Reviewed-by: Roberto Raggi <roberto.raggi@nokia.com>
Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com>
src/declarative/qml/qdeclarativescriptparser.cpp

index 748f2d7..71b0bd2 100644 (file)
@@ -544,7 +544,7 @@ bool ProcessAST::visit(AST::UiPublicMember *node)
 
         AST::UiParameterList *p = node->parameters;
         int paramLength = 0;
-        while (p) { paramLength++; p = p->finish(); }
+        while (p) { paramLength++; p = p->next; }
         p = node->parameters;
 
         if (paramLength) {
@@ -577,7 +577,7 @@ bool ProcessAST::visit(AST::UiPublicMember *node)
             
             signal->parameterTypes[index] = QHashedCStringRef(type->qtName, type->qtNameLength);
             signal->parameterNames[index] = QHashedStringRef(p->name);
-            p = p->finish();
+            p = p->next;
             index++;
         }
 
@@ -844,7 +844,7 @@ bool ProcessAST::visit(AST::UiSourceElement *node)
         AST::FormalParameterList *f = funDecl->formals;
         while (f) {
             slot->parameterNames << f->name.toUtf8();
-            f = f->finish();
+            f = f->next;
         }
 
         AST::SourceLocation loc = funDecl->rparenToken;