EdGarrity / SOS

Search for an Optimum Solution
1 stars 0 forks source link

Fixes #39 - Unexplained Crash with No Error Message #41

Closed EdGarrity closed 5 years ago

EdGarrity commented 5 years ago

Running the code in debug mode revealed that the crash was caused by run_individual_program() being called with a very large value for the individual_index parameter (4294967295). Tracing this back through the call stack showed that the large value was produced by a type cast conversion of -1 from int to unsigned int in eval_one_day_of_test_case(). The value of -1 was put in the list of individual indexes provided by generate_status_report() to mark test cases which do not have any solutions.

To fix the issue, I changed the collection of individual indexes from unsigned int to int and modified eval_one_day_of_test_case() to ignore index values of -1