mirror of
https://github.com/tinygo-org/tinygo.git
synced 2026-08-03 02:27:48 +00:00
Fix bug in runtime.memzero
Not the memory itself, but the byte after the memory was zeroed.
This commit is contained in:
@@ -43,7 +43,7 @@ func memcpy(dst, src unsafe.Pointer, size uintptr) {
|
||||
// Set the given number of bytes to zero.
|
||||
func memzero(ptr unsafe.Pointer, size uintptr) {
|
||||
for i := uintptr(0); i < size; i++ {
|
||||
*(*byte)(unsafe.Pointer(uintptr(ptr) + size)) = 0
|
||||
*(*byte)(unsafe.Pointer(uintptr(ptr) + i)) = 0
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user