Fix deadlock when calling functions recursively.

Fixes #6178
This commit is contained in:
Gunnar Beutner 2014-05-09 14:45:59 +02:00
parent b367187c0b
commit bd8ccec258
1 changed files with 9 additions and 6 deletions

View File

@ -263,8 +263,9 @@ Value AExpression::OpFunctionCall(const AExpression *expr, const Dictionary::Ptr
Array::Ptr arr = expr->EvaluateOperand2(locals);
std::vector<Value> arguments;
ObjectLock olock(arr);
BOOST_FOREACH(const AExpression::Ptr& aexpr, arr) {
int index = 0;
for (int index = 0; index < arr->GetLength(); index++) {
const AExpression::Ptr& aexpr = arr->Get(index);
arguments.push_back(aexpr->Evaluate(locals));
}
@ -277,8 +278,9 @@ Value AExpression::OpArray(const AExpression *expr, const Dictionary::Ptr& local
Array::Ptr result = make_shared<Array>();
if (arr) {
ObjectLock olock(arr);
BOOST_FOREACH(const AExpression::Ptr& aexpr, arr) {
int index = 0;
for (int index = 0; index < arr->GetLength(); index++) {
const AExpression::Ptr& aexpr = arr->Get(index);
result->Add(aexpr->Evaluate(locals));
}
}
@ -295,8 +297,9 @@ Value AExpression::OpDict(const AExpression *expr, const Dictionary::Ptr& locals
result->Set("__parent", locals);
if (arr) {
ObjectLock olock(arr);
BOOST_FOREACH(const AExpression::Ptr& aexpr, arr) {
int index = 0;
for (int index = 0; index < arr->GetLength(); index++) {
const AExpression::Ptr& aexpr = arr->Get(index);
Dictionary::Ptr alocals = in_place ? locals : result;
aexpr->Evaluate(alocals);