From 09a6612742f9e19f7026f091ab16dd5e13fb6297 Mon Sep 17 00:00:00 2001 From: deadprogram Date: Sun, 15 Feb 2026 19:24:16 +0100 Subject: [PATCH] fix: init heap before random number seed on wasm platforms This changes the order for initialization of the random number seed generation on wasm platforms until after the heap has been initialized. Should fix #5198 Signed-off-by: deadprogram --- src/runtime/runtime_wasmentry.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/runtime/runtime_wasmentry.go b/src/runtime/runtime_wasmentry.go index 005b58641..59cacb3b0 100644 --- a/src/runtime/runtime_wasmentry.go +++ b/src/runtime/runtime_wasmentry.go @@ -34,8 +34,8 @@ func wasmEntryReactor() { // Initialize the heap. heapStart = uintptr(unsafe.Pointer(&heapStartSymbol)) heapEnd = uintptr(wasm_memory_size(0) * wasmPageSize) - initRand() initHeap() + initRand() if hasScheduler { // A package initializer might do funky stuff like start a goroutine and