Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ast/compile: reorder body for safety differently #4801

Commits on Jun 21, 2022

  1. ast/compile: reorder body for safety differently

    Our previous approach, ordering for closures first, and taking the growing
    set of output variables of the reordered body into account in a second step,
    did not work out for some examples:
    
        object.get(input.subject.roles[_], comp, [""], output)
        comp = [ 1 | true ]
        every y in [2] {
        	y in output
        }
    
    Here, the closure of `every` would have not checkout out because we've never
    registered the output variable `output` -- since the first call to object.get
    is unsafe without `comp`, too.
    
    Now, the two stages have been merged. It's got surprisingly little fallout,
    one test case had to be adjusted, which I believe to be a minor case, too.
    
    Fixes the second part of open-policy-agent#4766.
    
    Signed-off-by: Stephan Renatus <stephan.renatus@gmail.com>
    srenatus committed Jun 21, 2022
    Copy the full SHA
    7823c8d View commit details
    Browse the repository at this point in the history

Commits on Jun 29, 2022

  1. Copy the full SHA
    f89eb99 View commit details
    Browse the repository at this point in the history