mirror of
https://github.com/nspcc-dev/neo-go.git
synced 2024-12-24 09:25:21 +00:00
vm: check for fault flag first in Run()
Switch cases are evaluated sequentially and the fault case is top-priority to handle.
This commit is contained in:
parent
705c7f106f
commit
0c963875af
1 changed files with 3 additions and 3 deletions
|
@ -225,6 +225,9 @@ func (v *VM) Run() {
|
|||
v.state = noneState
|
||||
for {
|
||||
switch {
|
||||
case v.state.HasFlag(faultState):
|
||||
fmt.Println("FAULT")
|
||||
return
|
||||
case v.state.HasFlag(haltState):
|
||||
if !v.mute {
|
||||
fmt.Println(v.Stack("estack"))
|
||||
|
@ -235,9 +238,6 @@ func (v *VM) Run() {
|
|||
i, op := ctx.CurrInstr()
|
||||
fmt.Printf("at breakpoint %d (%s)\n", i, op.String())
|
||||
return
|
||||
case v.state.HasFlag(faultState):
|
||||
fmt.Println("FAULT")
|
||||
return
|
||||
case v.state == noneState:
|
||||
v.Step()
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue