mirror of
https://github.com/tinygo-org/tinygo.git
synced 2026-08-03 02:27:48 +00:00
interp: do not try to interpret past task.Pause()
For context, see: https://github.com/tinygo-org/tinygo/pull/2863#issuecomment-1133875237 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 https://github.com/tinygo-org/tinygo/issues/2842 (I didn't investigate exactly why).
This commit is contained in:
committed by
Ron Evans
parent
4ed0936c0e
commit
dd1a836903
@@ -219,6 +219,9 @@ func (r *runner) run(fn *function, params []value, parentMem *memoryView, indent
|
||||
if err != nil {
|
||||
return nil, mem, err
|
||||
}
|
||||
case callFn.name == "internal/task.Pause":
|
||||
// Task scheduling isn't possible at compile time.
|
||||
return nil, mem, r.errorAt(inst, errUnsupportedRuntimeInst)
|
||||
case callFn.name == "runtime.nanotime" && r.pkgName == "time":
|
||||
// The time package contains a call to runtime.nanotime.
|
||||
// This appears to be to work around a limitation in Windows
|
||||
|
||||
Reference in New Issue
Block a user