Upgrade dependent version: github.com/open-policy-agent/opa (#5315)

Upgrade dependent version: github.com/open-policy-agent/opa v0.18.0 -> v0.45.0

Signed-off-by: hongzhouzi <hongzhouzi@kubesphere.io>

Signed-off-by: hongzhouzi <hongzhouzi@kubesphere.io>
This commit is contained in:
hongzhouzi
2022-10-31 10:58:55 +08:00
committed by GitHub
parent 668fca1773
commit ef03b1e3df
363 changed files with 277341 additions and 13544 deletions

View File

@@ -9,7 +9,12 @@ import (
"github.com/open-policy-agent/opa/internal/wasm/types"
)
// Unreachable reprsents an unreachable opcode.
// !!! If you find yourself adding support for more control
// instructions (br_table, if, ...), please adapt the
// `withControlInstr` functions of
// `compiler/wasm/optimizations.go`
// Unreachable represents a WASM unreachable instruction.
type Unreachable struct {
NoImmediateArgs
}
@@ -51,6 +56,29 @@ func (i Block) Instructions() []Instruction {
return i.Instrs
}
// If represents a WASM if instruction.
// NOTE(sr): we only use if with one branch so far!
type If struct {
NoImmediateArgs
Type *types.ValueType
Instrs []Instruction
}
// Op returns the opcode of the instruction.
func (If) Op() opcode.Opcode {
return opcode.If
}
// BlockType returns the type of the if's THEN branch.
func (i If) BlockType() *types.ValueType {
return i.Type
}
// Instructions represents the instructions contained in the if's THEN branch.
func (i If) Instructions() []Instruction {
return i.Instrs
}
// Loop represents a WASM loop instruction.
type Loop struct {
NoImmediateArgs
@@ -118,6 +146,22 @@ func (i Call) ImmediateArgs() []interface{} {
return []interface{}{i.Index}
}
// CallIndirect represents a WASM call_indirect instruction.
type CallIndirect struct {
Index uint32 // type index
Reserved byte // zero for now
}
// Op returns the opcode of the instruction.
func (CallIndirect) Op() opcode.Opcode {
return opcode.CallIndirect
}
// ImmediateArgs returns the function index.
func (i CallIndirect) ImmediateArgs() []interface{} {
return []interface{}{i.Index, i.Reserved}
}
// Return represents a WASM return instruction.
type Return struct {
NoImmediateArgs