diff options
author | Ayke van Laethem <[email protected]> | 2021-05-10 23:43:14 +0200 |
---|---|---|
committer | Ron Evans <[email protected]> | 2021-05-11 00:17:03 +0200 |
commit | ff5d0c9886292b21c75e0762d90da43f96c02430 (patch) | |
tree | 2c749bb9dd06981fedc1bfc79c8b6146a562cee0 | |
parent | d7ec9ddcd23e7ba8bab2cb50780a6fda573ae8f3 (diff) | |
download | tinygo-ff5d0c9886292b21c75e0762d90da43f96c02430.tar.gz tinygo-ff5d0c9886292b21c75e0762d90da43f96c02430.zip |
compiler: only check for default stack size with tasks scheduler
With -scheduler=none, there are no goroutines so there is no stack size
anywhere. Therefore, don't check whether the default stack size is set.
-rw-r--r-- | compiler/goroutine.go | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/compiler/goroutine.go b/compiler/goroutine.go index 20a1ad6d8..f98fe2462 100644 --- a/compiler/goroutine.go +++ b/compiler/goroutine.go @@ -34,7 +34,7 @@ func (b *builder) createGoInstruction(funcPtr llvm.Value, params []llvm.Value, p } else { // The stack size is fixed at compile time. By emitting it here as a // constant, it can be optimized. - if b.DefaultStackSize == 0 { + if b.Scheduler == "tasks" && b.DefaultStackSize == 0 { b.addError(pos, "default stack size for goroutines is not set") } stackSize = llvm.ConstInt(b.uintptrType, b.DefaultStackSize, false) |