From: Erik Verbruggen Date: Fri, 1 Mar 2013 13:34:56 +0000 (+0100) Subject: Do not re-use temp for both parameter and result. X-Git-Tag: upstream/5.2.1~669^2~659^2~177 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=76246ab72d303cc59094e746831eaca3bcc59bef;p=platform%2Fupstream%2Fqtdeclarative.git Do not re-use temp for both parameter and result. Change-Id: Iffd50459bc55960ac5cef1e246cd3d2664565a8a Reviewed-by: Lars Knoll --- diff --git a/src/v4/qv4codegen.cpp b/src/v4/qv4codegen.cpp index 77e1a15..16839fa 100644 --- a/src/v4/qv4codegen.cpp +++ b/src/v4/qv4codegen.cpp @@ -2171,10 +2171,12 @@ bool Codegen::visit(ForEachStatement *ast) enterLoop(ast, foreachend, foreachin); - int iterator = _block->newTemp(); - move(_block->TEMP(iterator), *expression(ast->expression)); + int objectToIterateOn = _block->newTemp(); + move(_block->TEMP(objectToIterateOn), *expression(ast->expression)); IR::ExprList *args = _function->New(); - args->init(_block->TEMP(iterator)); + args->init(_block->TEMP(objectToIterateOn)); + + int iterator = _block->newTemp(); move(_block->TEMP(iterator), _block->CALL(_block->NAME(IR::Name::builtin_foreach_iterator_object, 0, 0), args)); _block->JUMP(foreachin);