summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThiago Macieira <thiago.macieira@intel.com>2014-04-02 23:12:52 -0700
committerThe Qt Project <gerrit-noreply@qt-project.org>2014-04-04 22:17:13 +0200
commitfc86116dfd8559764b2cd21fcfdb7c5d2d739aa3 (patch)
treeff1f10912b92f48b87f2378bb510c0a00c910c78
parent2ee0b6ed788325cad73c3646ab2d72eadeeb1b0c (diff)
Don't append garbage to the function parameter slotswip/gc
If the argument is neither a temporary nor a constant, slot isn't initialized. So don't try to add it. qqmltypecompiler.cpp:2548:36: error: variable 'slot' is used uninitialized whenever 'if' condition is false [-Werror,-Wsometimes-uninitialized] qqmltypecompiler.cpp:2553:36: note: uninitialized use occurs here _functionParameters.append(slot); ^~~~ Change-Id: I5a538bfa0ef1fbbd00e23dfd6e15c404359c7c46 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com> Reviewed-by: Lars Knoll <lars.knoll@digia.com>
-rw-r--r--src/qml/compiler/qqmltypecompiler.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/qml/compiler/qqmltypecompiler.cpp b/src/qml/compiler/qqmltypecompiler.cpp
index 087f8df8a5..b5ddf3bc59 100644
--- a/src/qml/compiler/qqmltypecompiler.cpp
+++ b/src/qml/compiler/qqmltypecompiler.cpp
@@ -2653,12 +2653,13 @@ void QQmlJavaScriptBindingExpressionSimplificationPass::visitFunctionCall(const
return;
}
slot = param->index;
+ _functionParameters.append(slot);
} else if (QV4::IR::Const *param = args->expr->asConst()) {
slot = --_synthesizedConsts;
Q_ASSERT(!_temps.contains(slot));
_temps[slot] = param;
+ _functionParameters.append(slot);
}
- _functionParameters.append(slot);
args = args->next;
}