Skip to content

Commit

Permalink
fix #171 (#172)
Browse files Browse the repository at this point in the history
  • Loading branch information
d5 authored Apr 1, 2019
1 parent 8dc0d7b commit 17a50b7
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion runtime/vm.go
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,8 @@ func (v *VM) Run() (err error) {

v.run()

atomic.StoreInt64(&v.aborting, 0)

err = v.err
if err != nil {
filePos := v.fileSet.Position(v.curFrame.fn.SourcePos(v.ip - 1))
Expand Down Expand Up @@ -115,7 +117,7 @@ func (v *VM) run() {
}
}()

for atomic.CompareAndSwapInt64(&v.aborting, 0, 0) {
for atomic.LoadInt64(&v.aborting) == 0 {
v.ip++

switch v.curInsts[v.ip] {
Expand Down

0 comments on commit 17a50b7

Please sign in to comment.