Skip to content

Commit dd1a836

Browse files
aykevldeadprogram
authored andcommitted
interp: do not try to interpret past task.Pause()
For context, see: #2863 (comment) Basically, testdata/goroutine.go was doing `time.Sleep()` inside an init function which broke because doing that from a non-goroutine is not allowed. However, we never hit this bug because of #2842 (I didn't investigate exactly why).
1 parent 4ed0936 commit dd1a836

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

interp/interpreter.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -219,6 +219,9 @@ func (r *runner) run(fn *function, params []value, parentMem *memoryView, indent
219219
if err != nil {
220220
return nil, mem, err
221221
}
222+
case callFn.name == "internal/task.Pause":
223+
// Task scheduling isn't possible at compile time.
224+
return nil, mem, r.errorAt(inst, errUnsupportedRuntimeInst)
222225
case callFn.name == "runtime.nanotime" && r.pkgName == "time":
223226
// The time package contains a call to runtime.nanotime.
224227
// This appears to be to work around a limitation in Windows

0 commit comments

Comments
 (0)