[icinga-checkins] icinga.org: icinga2/fix/add-missing-suse-build-requirement-7741: Fix scoping for __for

git at icinga.org git at icinga.org
Tue Nov 25 12:10:22 CET 2014


Module: icinga2
Branch: fix/add-missing-suse-build-requirement-7741
Commit: e93595c00620c506d1198ea4b39fa2fd8d270484
URL:    https://git.icinga.org/?p=icinga2.git;a=commit;h=e93595c00620c506d1198ea4b39fa2fd8d270484

Author: Gunnar Beutner <gunnar.beutner at netways.de>
Date:   Sun Nov 23 20:43:50 2014 +0100

Fix scoping for __for

fixes #7809

---

 lib/config/config_parser.yy |   10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)

diff --git a/lib/config/config_parser.yy b/lib/config/config_parser.yy
index 4625dac..2b98b01 100644
--- a/lib/config/config_parser.yy
+++ b/lib/config/config_parser.yy
@@ -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);
 	}
 	;



More information about the icinga-checkins mailing list