mirror of
https://github.com/open-policy-agent/opa.git
synced 2026-08-27 02:34:52 -06:00
e861bbaa48
So the check introduced before was too broad: it aborted optimizations
at the wrong spot -- the resulting plan didn't add up: path lengths used
in CallDynamicStmt didn't match path lengths that the planned funcs
had.
So, while this change looks like over-fitting (also to me), we're really
trying to make test previous fix more specific.
Generally looking at that section of the planner, it feels like the intro
of general refs would be a good moment to nuke and start over: the way
that refs-with-vars are put into the ruletrie seems like the root cause of
our trouble here.
Fixes #5964.
Signed-off-by: Stephan Renatus <stephan@styra.com>
(cherry picked from commit a8080563a2)