Update dependencies (#5518)
This commit is contained in:
3
vendor/github.com/open-policy-agent/opa/internal/compiler/wasm/opa/callgraph.csv
generated
vendored
3
vendor/github.com/open-policy-agent/opa/internal/compiler/wasm/opa/callgraph.csv
generated
vendored
@@ -524,6 +524,9 @@ builtin_object_filter,opa_object_get
|
||||
builtin_object_filter,opa_object_insert
|
||||
builtin_object_get,opa_value_type
|
||||
builtin_object_get,opa_value_get
|
||||
builtin_object_keys,opa_value_type
|
||||
builtin_object_keys,opa_set_with_cap
|
||||
builtin_object_keys,opa_set_add
|
||||
builtin_object_remove,opa_value_type
|
||||
builtin_object_remove,opa_set
|
||||
builtin_object_remove,opa_value_iter
|
||||
|
||||
|
BIN
vendor/github.com/open-policy-agent/opa/internal/compiler/wasm/opa/opa.wasm
generated
vendored
BIN
vendor/github.com/open-policy-agent/opa/internal/compiler/wasm/opa/opa.wasm
generated
vendored
Binary file not shown.
12
vendor/github.com/open-policy-agent/opa/internal/compiler/wasm/wasm.go
generated
vendored
12
vendor/github.com/open-policy-agent/opa/internal/compiler/wasm/wasm.go
generated
vendored
@@ -139,6 +139,7 @@ var builtinsFunctions = map[string]string{
|
||||
ast.JSONIsValid.Name: "opa_json_is_valid",
|
||||
ast.ObjectFilter.Name: "builtin_object_filter",
|
||||
ast.ObjectGet.Name: "builtin_object_get",
|
||||
ast.ObjectKeys.Name: "builtin_object_keys",
|
||||
ast.ObjectRemove.Name: "builtin_object_remove",
|
||||
ast.ObjectUnion.Name: "builtin_object_union",
|
||||
ast.Concat.Name: "opa_strings_concat",
|
||||
@@ -603,7 +604,7 @@ func (c *Compiler) writeExternalFuncNames(buf *bytes.Buffer) {
|
||||
|
||||
for _, decl := range c.policy.Static.BuiltinFuncs {
|
||||
if _, ok := builtinsFunctions[decl.Name]; !ok {
|
||||
addr := int32(buf.Len()) + int32(c.stringOffset)
|
||||
addr := int32(buf.Len()) + c.stringOffset
|
||||
buf.WriteString(decl.Name)
|
||||
buf.WriteByte(0)
|
||||
c.externalFuncNameAddrs[decl.Name] = addr
|
||||
@@ -615,7 +616,7 @@ func (c *Compiler) writeEntrypointNames(buf *bytes.Buffer) {
|
||||
c.entrypointNameAddrs = make(map[string]int32)
|
||||
|
||||
for _, plan := range c.policy.Plans.Plans {
|
||||
addr := int32(buf.Len()) + int32(c.stringOffset)
|
||||
addr := int32(buf.Len()) + c.stringOffset
|
||||
buf.WriteString(plan.Name)
|
||||
buf.WriteByte(0)
|
||||
c.entrypointNameAddrs[plan.Name] = addr
|
||||
@@ -886,12 +887,9 @@ func (c *Compiler) compileFunc(fn *ir.Func) error {
|
||||
}
|
||||
|
||||
func mapFunc(mapping ast.Object, fn *ir.Func, index int) (ast.Object, bool) {
|
||||
curr := ast.NewObject()
|
||||
curr.Insert(ast.StringTerm(fn.Path[len(fn.Path)-1]), ast.IntNumberTerm(index))
|
||||
curr := ast.NewObject(ast.Item(ast.StringTerm(fn.Path[len(fn.Path)-1]), ast.IntNumberTerm(index)))
|
||||
for i := len(fn.Path) - 2; i >= 0; i-- {
|
||||
o := ast.NewObject()
|
||||
o.Insert(ast.StringTerm(fn.Path[i]), ast.NewTerm(curr))
|
||||
curr = o
|
||||
curr = ast.NewObject(ast.Item(ast.StringTerm(fn.Path[i]), ast.NewTerm(curr)))
|
||||
}
|
||||
return mapping.Merge(curr)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user