Fix 114661 via cel-go bump to 0.12.6 to pick up cel-go#620

This commit is contained in:
Joe Betz
2023-01-05 14:24:00 -05:00
parent 41976c813b
commit 8a69d206a2
18 changed files with 29 additions and 26 deletions

View File

@@ -213,7 +213,10 @@ func newProgram(e *Env, ast *Ast, opts []ProgramOption) (Program, error) {
factory := func(state interpreter.EvalState, costTracker *interpreter.CostTracker) (Program, error) {
costTracker.Estimator = p.callCostEstimator
costTracker.Limit = p.costLimit
decs := decorators
// Limit capacity to guarantee a reallocation when calling 'append(decs, ...)' below. This
// prevents the underlying memory from being shared between factory function calls causing
// undesired mutations.
decs := decorators[:len(decorators):len(decorators)]
var observers []interpreter.EvalObserver
if p.evalOpts&(OptExhaustiveEval|OptTrackState) != 0 {