mirror of
https://github.com/nspcc-dev/neo-go.git
synced 2024-11-26 09:42:22 +00:00
vm: clear state in Load()
Make VM usable after the first run.
This commit is contained in:
parent
0ea7568caa
commit
ae7687422c
1 changed files with 2 additions and 1 deletions
|
@ -196,10 +196,11 @@ func (v *VM) LoadFile(path string) error {
|
|||
|
||||
// Load initializes the VM with the program given.
|
||||
func (v *VM) Load(prog []byte) {
|
||||
// clear all stacks, it could be a reload.
|
||||
// Clear all stacks and state, it could be a reload.
|
||||
v.istack.Clear()
|
||||
v.estack.Clear()
|
||||
v.astack.Clear()
|
||||
v.state = noneState
|
||||
v.LoadScript(prog)
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue