vm: make StepOut/StepOver match original VM behavior
This commit is contained in:
parent
9ebb793009
commit
7d40d2f71e
1 changed files with 7 additions and 2 deletions
|
@ -376,7 +376,7 @@ func (v *VM) StepOut() error {
|
||||||
}
|
}
|
||||||
|
|
||||||
expSize := v.istack.len
|
expSize := v.istack.len
|
||||||
for v.state.HasFlag(noneState) && v.istack.len >= expSize {
|
for v.state == noneState && v.istack.len >= expSize {
|
||||||
err = v.StepInto()
|
err = v.StepInto()
|
||||||
}
|
}
|
||||||
return err
|
return err
|
||||||
|
@ -399,10 +399,15 @@ func (v *VM) StepOver() error {
|
||||||
expSize := v.istack.len
|
expSize := v.istack.len
|
||||||
for {
|
for {
|
||||||
err = v.StepInto()
|
err = v.StepInto()
|
||||||
if !(v.state.HasFlag(noneState) && v.istack.len > expSize) {
|
if !(v.state == noneState && v.istack.len > expSize) {
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if v.state == noneState {
|
||||||
|
v.state = breakState
|
||||||
|
}
|
||||||
|
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue