From 4ec939f33205baa652b929e8f854c20b2c87b77a Mon Sep 17 00:00:00 2001 From: Gunnar Beutner Date: Mon, 24 Mar 2014 09:44:18 +0100 Subject: [PATCH] Some more variable scoping fixes. Refs #5846 --- lib/config/aexpression.cpp | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/lib/config/aexpression.cpp b/lib/config/aexpression.cpp index e09be8de8..5a56aa423 100644 --- a/lib/config/aexpression.cpp +++ b/lib/config/aexpression.cpp @@ -357,9 +357,14 @@ Value AExpression::OpSetPlus(const AExpression *expr, const Dictionary::Ptr& loc if (!xlocals) xlocals = make_shared(); + + xlocals->Set("__parent", locals); } Value result = left + expr->EvaluateOperand2(xlocals); + + xlocals->Remove("__parent"); + locals->Set(expr->m_Operand1, result); return result; } @@ -375,9 +380,14 @@ Value AExpression::OpSetMinus(const AExpression *expr, const Dictionary::Ptr& lo if (!xlocals) xlocals = make_shared(); + + xlocals->Set("__parent", locals); } Value result = left - expr->EvaluateOperand2(xlocals); + + xlocals->Remove("__parent"); + locals->Set(expr->m_Operand1, result); return result; } @@ -393,9 +403,14 @@ Value AExpression::OpSetMultiply(const AExpression *expr, const Dictionary::Ptr& if (!xlocals) xlocals = make_shared(); + + xlocals->Set("__parent", locals); } Value result = left * expr->EvaluateOperand2(xlocals); + + xlocals->Remove("__parent"); + locals->Set(expr->m_Operand1, result); return result; } @@ -411,9 +426,14 @@ Value AExpression::OpSetDivide(const AExpression *expr, const Dictionary::Ptr& l if (!xlocals) xlocals = make_shared(); + + xlocals->Set("__parent", locals); } Value result = left / expr->EvaluateOperand2(xlocals); + + xlocals->Remove("__parent"); + locals->Set(expr->m_Operand1, result); return result; }