Commit 13095a4e authored by George Hotz's avatar George Hotz

even simpler

parent 3dda5814
package main package main
import ( import (
"encoding/binary"
"log" "log"
"testing" "testing"
...@@ -14,21 +13,11 @@ func TestUnicornCrash(t *testing.T) { ...@@ -14,21 +13,11 @@ func TestUnicornCrash(t *testing.T) {
log.Fatal(err) log.Fatal(err)
} }
// program // weird heap grooming (doesn't crash without this)
dat := make([]byte, 1490944)
for i := 0; i < len(dat); i++ {
dat[i] = 0xaa
}
mu.MemWrite(0, dat)
// load into a map, without this (completely unrelated), it doesn't crash
ram := make(map[uint32](uint32)) ram := make(map[uint32](uint32))
for i := 0; i < len(dat); i += 4 { for i := 0; i < 1490944; i += 4 {
value := binary.BigEndian.Uint32(dat[i : i+4]) ram[uint32(i)] = 0xaaaaaaaa
if value != 0 {
ram[uint32(i)] = value
}
} }
mu.Start(0, 0x5ead0004) mu.Start(0, 4)
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment