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).
Этот коммит содержится в:
родитель
4ed0936c0e
коммит
dd1a836903
1 изменённых файлов: 3 добавлений и 0 удалений
|
@ -219,6 +219,9 @@ func (r *runner) run(fn *function, params []value, parentMem *memoryView, indent
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, mem, err
|
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":
|
case callFn.name == "runtime.nanotime" && r.pkgName == "time":
|
||||||
// The time package contains a call to runtime.nanotime.
|
// The time package contains a call to runtime.nanotime.
|
||||||
// This appears to be to work around a limitation in Windows
|
// This appears to be to work around a limitation in Windows
|
||||||
|
|
Загрузка…
Создание таблицы
Сослаться в новой задаче