From c64ca33d7e7e59d02e52576f6e5e1940b51e884f Mon Sep 17 00:00:00 2001 From: mdmarek Date: Mon, 3 May 2021 09:45:16 -0700 Subject: [PATCH] Respect max depth --- vm/vm.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/vm/vm.go b/vm/vm.go index 6b89cd0..306ae88 100644 --- a/vm/vm.go +++ b/vm/vm.go @@ -20,7 +20,7 @@ import ( var ( // MaxDepth acts as a guard against potentially recursive queries - MaxDepth = 100 + MaxDepth = 1000 // ErrMaxDepth If we hit max depth on recursion ErrMaxDepth = fmt.Errorf("Recursive Evaluation Error") // ErrUnknownOp an unrecognized Operator in expression @@ -209,7 +209,7 @@ func resolveInclude(ctx expr.Includer, inc *expr.IncludeNode, depth int) error { u.Debugf("Includer %T returned a nil filter statement!", inc) return expr.ErrIncludeNotFound } - if err = ResolveIncludes(ctx, incExpr); err != nil { + if err = resolveIncludesDepth(ctx, incExpr, depth+1); err != nil { return err } inc.ExprNode = incExpr