aboutsummaryrefslogtreecommitdiffstats
path: root/vendor/golang.org/x/net/bpf/vm.go
diff options
context:
space:
mode:
Diffstat (limited to 'vendor/golang.org/x/net/bpf/vm.go')
-rw-r--r--vendor/golang.org/x/net/bpf/vm.go10
1 files changed, 10 insertions, 0 deletions
diff --git a/vendor/golang.org/x/net/bpf/vm.go b/vendor/golang.org/x/net/bpf/vm.go
index 4c656f1..73f57f1 100644
--- a/vendor/golang.org/x/net/bpf/vm.go
+++ b/vendor/golang.org/x/net/bpf/vm.go
@@ -35,6 +35,13 @@ func NewVM(filter []Instruction) (*VM, error) {
if check <= int(ins.SkipFalse) {
return nil, fmt.Errorf("cannot jump %d instructions in false case; jumping past program bounds", ins.SkipFalse)
}
+ case JumpIfX:
+ if check <= int(ins.SkipTrue) {
+ return nil, fmt.Errorf("cannot jump %d instructions in true case; jumping past program bounds", ins.SkipTrue)
+ }
+ if check <= int(ins.SkipFalse) {
+ return nil, fmt.Errorf("cannot jump %d instructions in false case; jumping past program bounds", ins.SkipFalse)
+ }
// Check for division or modulus by zero
case ALUOpConstant:
if ins.Val != 0 {
@@ -109,6 +116,9 @@ func (v *VM) Run(in []byte) (int, error) {
case JumpIf:
jump := jumpIf(ins, regA)
i += jump
+ case JumpIfX:
+ jump := jumpIfX(ins, regA, regX)
+ i += jump
case LoadAbsolute:
regA, ok = loadAbsolute(ins, in)
case LoadConstant: