forked from open-policy-agent/opa
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ast: Rewrite input document when passed as an operand to a call
Earlier if a reference to the root of the input document was passed as operand in a call, it would not be rewritten to a local variable and substituted in the call. Refs to non-root input/data document would be rewritten. This was happening because we were updating the value of the input root ref term to a variable and as a result the compiler stage that rewrites the body of dynamic terms ('rewriteDynamicTerms') would not rewrite the input root ref. These changes modify the 'rewriteLocalVars' stage so that the value of root ref term is updated based on whether its value is an explicitly declared variable. If it isn't, then it will be rewritten in a later stage. Fixes open-policy-agent#2084 Signed-off-by: Ashutosh Narkar <anarkar4387@gmail.com>
- Loading branch information
1 parent
94cd44e
commit 517440d
Showing
2 changed files
with
43 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