nintendoswitch: Fix invalid memory read / write in print calls

This commit is contained in:
Lucas Teske
2020-09-09 13:51:00 -03:00
committed by GitHub
parent f20c932bb9
commit 0b9b293651
2 changed files with 8 additions and 17 deletions
+1 -7
View File
@@ -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