MCPcopy Create free account
hub / github.com/CPChain/chain / makeStackFunc

Function makeStackFunc

core/vm/stack_table.go:25–36  ·  view source on GitHub ↗
(pop, push int)

Source from the content-addressed store, hash-verified

23)
24
25func makeStackFunc(pop, push int) stackValidationFunc {
26 return func(stack *Stack) error {
27 if err := stack.require(pop); err != nil {
28 return err
29 }
30
31 if stack.len()+push-pop > int(configs.StackLimit) {
32 return fmt.Errorf("stack limit reached %d (%d)", stack.len(), configs.StackLimit)
33 }
34 return nil
35 }
36}
37
38func makeDupStackFunc(n int) stackValidationFunc {
39 return makeStackFunc(n, n+1)

Callers 6

makeDupStackFuncFunction · 0.85
makeSwapStackFuncFunction · 0.85

Calls 2

requireMethod · 0.80
lenMethod · 0.80

Tested by

no test coverage detected