Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
[mc] Fix MC_process_read_dynar_element
[simgrid.git] / src / mc / mc_state.c
index 3dc419d..0e0126b 100644 (file)
@@ -101,7 +101,7 @@ void MC_state_set_executed_request(mc_state_t state, smx_simcall_t req,
     state->internal_req.issuer = req->issuer;
     MC_process_read_dynar_element(&mc_model_checker->process,
       &state->internal_comm, simcall_comm_waitany__get__comms(req),
-      sizeof(state->internal_comm));
+      value, sizeof(state->internal_comm));
     simcall_comm_wait__set__comm(&state->internal_req, &state->internal_comm);
     simcall_comm_wait__set__timeout(&state->internal_req, 0);
     break;
@@ -113,7 +113,7 @@ void MC_state_set_executed_request(mc_state_t state, smx_simcall_t req,
     if (value > 0)
         MC_process_read_dynar_element(&mc_model_checker->process,
           &state->internal_comm, simcall_comm_testany__get__comms(req),
-          sizeof(state->internal_comm));
+          value, sizeof(state->internal_comm));
 
     simcall_comm_test__set__comm(&state->internal_req, &state->internal_comm);
     simcall_comm_test__set__result(&state->internal_req, value);
@@ -248,7 +248,7 @@ smx_simcall_t MC_state_get_request(mc_state_t state, int *value)
 
         case SIMCALL_MC_RANDOM:
           if (procstate->state == MC_INTERLEAVE)
-            *value = 0;
+            *value = simcall_mc_random__get__min(&process->simcall);
           else {
             if (state->req_num < simcall_mc_random__get__max(&process->simcall))
               *value = state->req_num + 1;