diff --git a/lib/config/expression.cpp b/lib/config/expression.cpp index f9241da3a..41235476f 100644 --- a/lib/config/expression.cpp +++ b/lib/config/expression.cpp @@ -707,9 +707,8 @@ void icinga::BindToScope(Expression *& expr, ScopeSpecifier scopeSpec) } LiteralExpression *lexpr = dynamic_cast(expr); - ScriptFrame frame; - if (lexpr && lexpr->Evaluate(frame).GetValue().IsString()) { + if (lexpr && lexpr->GetValue().IsString()) { Expression *scope = new GetScopeExpression(scopeSpec); expr = new IndexerExpression(scope, lexpr, lexpr->GetDebugInfo()); } diff --git a/lib/config/expression.hpp b/lib/config/expression.hpp index 3734d7183..5c35c2ad7 100644 --- a/lib/config/expression.hpp +++ b/lib/config/expression.hpp @@ -239,6 +239,11 @@ class I2_CONFIG_API LiteralExpression : public Expression public: LiteralExpression(const Value& value = Value()); + const Value& GetValue(void) const + { + return m_Value; + } + protected: virtual ExpressionResult DoEvaluate(ScriptFrame& frame, DebugHint *dhint) const override;