mirror of
https://github.com/tinygo-org/tinygo.git
synced 2026-08-15 00:13:43 +00:00
nintendoswitch: Fix invalid memory read / write in print calls
This commit is contained in:
@@ -4,17 +4,11 @@
|
||||
|
||||
package runtime
|
||||
|
||||
import "unsafe"
|
||||
|
||||
const heapSize = 0x2000000 * 16 // Default by libnx
|
||||
|
||||
//go:extern _stack_top
|
||||
var stackTopSymbol [0]byte
|
||||
|
||||
var (
|
||||
heapStart = uintptr(0)
|
||||
heapEnd = uintptr(0)
|
||||
stackTop = uintptr(unsafe.Pointer(&stackTopSymbol))
|
||||
)
|
||||
|
||||
//export setHeapSize
|
||||
@@ -24,7 +18,7 @@ func preinit() {
|
||||
setHeapSize(&heapStart, heapSize)
|
||||
|
||||
if heapStart == 0 {
|
||||
panic("failed to allocate heap")
|
||||
runtimePanic("failed to allocate heap")
|
||||
}
|
||||
|
||||
heapEnd = heapStart + heapSize
|
||||
|
||||
Reference in New Issue
Block a user