Skip to content

Commit ff5d0c9

Browse files
aykevldeadprogram
authored andcommitted
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.
1 parent d7ec9dd commit ff5d0c9

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

compiler/goroutine.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ func (b *builder) createGoInstruction(funcPtr llvm.Value, params []llvm.Value, p
3434
} else {
3535
// The stack size is fixed at compile time. By emitting it here as a
3636
// constant, it can be optimized.
37-
if b.DefaultStackSize == 0 {
37+
if b.Scheduler == "tasks" && b.DefaultStackSize == 0 {
3838
b.addError(pos, "default stack size for goroutines is not set")
3939
}
4040
stackSize = llvm.ConstInt(b.uintptrType, b.DefaultStackSize, false)

0 commit comments

Comments
 (0)