# HG changeset patch # User Mike Pavone # Date 1376225682 25200 # Node ID f4399a22a70465de5f8bb6a9f973fc8a5024ff6f # Parent 8409af16d6e5cc18532ce1f7dba3b2358d4569a4 Fix crash from calling srand during module initialization diff -r 8409af16d6e5 -r f4399a22a704 src/solver.tp --- a/src/solver.tp Sun Aug 11 04:35:02 2013 -0700 +++ b/src/solver.tp Sun Aug 11 05:54:42 2013 -0700 @@ -123,9 +123,9 @@ } #{ classify <- :prog trees numTests { + (os srand: (os time)) testvals <- #[] i <- 0 - (os srand: (os time)) while: {i < numTests} do: { i <- i + 1 testvals append: (uint64: (os rand64)) @@ -190,6 +190,7 @@ filtered append: tree } } + print: "Mismatch: went from " . (matches length) . " to " . (filtered length) . "\n" matches <- filtered if: (matches length) = 0 { print: "None of our programs actually matched 0x" . (hex: failOutput) ." with input 0x" . (hex: failInput) ." :(\n"