]> granicus.if.org Git - icinga2/commitdiff
Fix scoping for __for
authorGunnar Beutner <gunnar.beutner@netways.de>
Sun, 23 Nov 2014 19:43:50 +0000 (20:43 +0100)
committerGunnar Beutner <gunnar.beutner@netways.de>
Sun, 23 Nov 2014 19:43:50 +0000 (20:43 +0100)
fixes #7809

lib/config/config_parser.yy

index 4625dacc7216825df1f21052a13d25fcf26d9384..2b98b0198ebbdd0bd93234dafcd9182c204c65a0 100644 (file)
@@ -840,13 +840,19 @@ rterm_without_indexer: T_STRING
        }
        | T_FOR '(' identifier T_FOLLOWS identifier T_IN rterm ')' rterm_scope
        {
-               $$ = new ForExpression($3, $5, $7, $9, DebugInfoRange(@1, @9));
+               DictExpression *aexpr = dynamic_cast<DictExpression *>($9);
+               aexpr->MakeInline();
+
+               $$ = new ForExpression($3, $5, $7, aexpr, DebugInfoRange(@1, @9));
                free($3);
                free($5);
        }
        | T_FOR '(' identifier T_IN rterm ')' rterm_scope
        {
-               $$ = new ForExpression($3, "", $5, $7, DebugInfoRange(@1, @7));
+               DictExpression *aexpr = dynamic_cast<DictExpression *>($7);
+               aexpr->MakeInline();
+
+               $$ = new ForExpression($3, "", $5, aexpr, DebugInfoRange(@1, @7));
                free($3);
        }
        ;