diff --git a/src/runtime/gc_leaking.go b/src/runtime/gc_leaking.go index 2dc76af3..60340c64 100644 --- a/src/runtime/gc_leaking.go +++ b/src/runtime/gc_leaking.go @@ -53,7 +53,12 @@ func SetFinalizer(obj interface{}, finalizer interface{}) { func initHeap() { // preinit() may have moved heapStart; reset heapptr - heapptr = heapStart + ptr := heapStart + if GOARCH == "wasm" { + // llvm11 and llvm12 do not correctly align the heap on wasm + ptr = align(ptr) + } + heapptr = ptr } // setHeapEnd sets a new (larger) heapEnd pointer.