Commit 20983b85 authored by George Hotz's avatar George Hotz

fix atoi

parent 64f4d051
...@@ -24,7 +24,7 @@ func main() { ...@@ -24,7 +24,7 @@ func main() {
root = fmt.Sprintf("/tmp/cannon/%d_%d", 0, blockNumber) root = fmt.Sprintf("/tmp/cannon/%d_%d", 0, blockNumber)
} }
if len(os.Args) > 2 { if len(os.Args) > 2 {
target = strconv.Atoi(os.Args[2]) target, _ = strconv.Atoi(os.Args[2])
} }
// step 1, generate the checkpoints every million steps using unicorn // step 1, generate the checkpoints every million steps using unicorn
...@@ -33,7 +33,7 @@ func main() { ...@@ -33,7 +33,7 @@ func main() {
lastStep := 0 lastStep := 0
mu := GetHookedUnicorn(root, ram, func(step int, mu uc.Unicorn, ram map[uint32](uint32)) { mu := GetHookedUnicorn(root, ram, func(step int, mu uc.Unicorn, ram map[uint32](uint32)) {
// this can be raised to 10,000,000 if the files are too large // this can be raised to 10,000,000 if the files are too large
if step%10000000 == 0 || (target != -1 && step == target) { if step%10000000 == 0 || step == target {
SyncRegs(mu, ram) SyncRegs(mu, ram)
fn := fmt.Sprintf("%s/checkpoint_%d.json", root, step) fn := fmt.Sprintf("%s/checkpoint_%d.json", root, step)
WriteCheckpoint(ram, fn, step) WriteCheckpoint(ram, fn, step)
......
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