mirror of
https://github.com/nspcc-dev/neo-go.git
synced 2024-11-26 19:42:23 +00:00
vm: don't allocate another stack for entry scripts
vm.New() creates a new stack, then we load an entry script with LoadScriptWithFlags and it creates another one which doesn't make much sense. rvcount is -1 for it, so all elements are to be copied down anyway and it's clear so a new loaded script can't dig down to anything it shouldn't be able to.
This commit is contained in:
parent
ac7e922606
commit
53cfde62de
1 changed files with 3 additions and 1 deletions
|
@ -317,7 +317,9 @@ func (v *VM) loadScriptWithCallingHash(b []byte, exe *nef.File, caller util.Uint
|
|||
|
||||
v.checkInvocationStackSize()
|
||||
ctx := NewContextWithParams(b, rvcount, offset)
|
||||
if rvcount != -1 || v.estack.Len() != 0 {
|
||||
v.estack = newStack("evaluation", &v.refs)
|
||||
}
|
||||
ctx.estack = v.estack
|
||||
initStack(&ctx.tryStack, "exception", nil)
|
||||
ctx.callFlag = f
|
||||
|
|
Loading…
Reference in a new issue