diff --git a/code/permuter/RandomPermuter.cpp b/code/permuter/RandomPermuter.cpp index 2c420c82..d5a34834 100644 --- a/code/permuter/RandomPermuter.cpp +++ b/code/permuter/RandomPermuter.cpp @@ -33,6 +33,10 @@ void RandomPermuter::init_data(vector *data) { bool RandomPermuter::gen_one_state(vector& res, PermuteTestResult &log_data) { + // Return if there are no ops to permute and generate a crash state + if (res.size() == 0) { + return false; + } unsigned int total_elements = 0; // Find how many elements we will be returning (randomly determined). uniform_int_distribution permute_epochs(1, GetEpochs()->size());