land/vendor/github.com/go-interpreter/wagon/exec/parametric.go

22 lines
433 B
Go
Raw Normal View History

2018-06-17 23:39:04 +00:00
// Copyright 2017 The go-interpreter Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
package exec
func (vm *VM) drop() {
vm.ctx.stack = vm.ctx.stack[:len(vm.ctx.stack)-1]
}
func (vm *VM) selectOp() {
c := vm.popUint32()
val2 := vm.popUint64()
val1 := vm.popUint64()
if c != 0 {
vm.pushUint64(val1)
} else {
vm.pushUint64(val2)
}
}