changeset 50:f4399a22a704

Fix crash from calling srand during module initialization
author Mike Pavone <pavone@retrodev.com>
date Sun, 11 Aug 2013 05:54:42 -0700
parents 8409af16d6e5
children e634e81c4c84
files src/solver.tp
diffstat 1 files changed, 2 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- 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"