mirror of
https://github.com/tinygo-org/tinygo.git
synced 2026-08-03 02:27:48 +00:00
fix miscompile of static goroutine calls to closures
This commit is contained in:
Vendored
+10
@@ -41,6 +41,16 @@ func main() {
|
||||
})
|
||||
|
||||
time.Sleep(2 * time.Millisecond)
|
||||
|
||||
var x int
|
||||
go func() {
|
||||
time.Sleep(2 * time.Millisecond)
|
||||
x = 1
|
||||
}()
|
||||
time.Sleep(time.Second/2)
|
||||
println("closure go call result:", x)
|
||||
|
||||
time.Sleep(2 * time.Millisecond)
|
||||
}
|
||||
|
||||
func sub() {
|
||||
|
||||
Vendored
+1
@@ -13,3 +13,4 @@ done with non-blocking goroutine
|
||||
async interface method call
|
||||
slept inside func pointer 8
|
||||
slept inside closure, with value: 20 8
|
||||
closure go call result: 1
|
||||
|
||||
Reference in New Issue
Block a user