From: Roberto Raggi Date: Mon, 1 Aug 2011 16:04:30 +0000 (+0200) Subject: Fix visit of list-like AST nodes. X-Git-Tag: qt-v5.0.0-alpha1~1809 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=f5d53893b8bc8015636e107d414d2e09ee04c577;p=profile%2Fivi%2Fqtdeclarative.git Fix visit of list-like AST nodes. 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 Reviewed-by: Qt Sanity Bot --- diff --git a/src/declarative/qml/qdeclarativescriptparser.cpp b/src/declarative/qml/qdeclarativescriptparser.cpp index 748f2d7..71b0bd2 100644 --- a/src/declarative/qml/qdeclarativescriptparser.cpp +++ b/src/declarative/qml/qdeclarativescriptparser.cpp @@ -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;