forked from open-policy-agent/opa
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ast/compile: fix print rewriting for arrays in := and head vars
For both partial and complete rules, when variables from destructured arrays in assignments had been used in the rule head, the print rewriting would fail. Now, this situation is accounted for by starting the safe VarSet with r.Head.Vars() instead of r.Head.Args.Vars() The former will check each of the Args, Key and Value fields of Head: if it's non-empty, it'll add .Vars() to the returned VarSet. Fixes open-policy-agent#4078. Signed-off-by: Stephan Renatus <stephan.renatus@gmail.com>
- Loading branch information
Showing
2 changed files
with
31 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters