Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Additionnal checks for Henri ;)
authoralegrand <alegrand@48e7efb5-ca39-0410-a469-dd3cf9ba447f>
Fri, 26 Aug 2005 19:28:58 +0000 (19:28 +0000)
committeralegrand <alegrand@48e7efb5-ca39-0410-a469-dd3cf9ba447f>
Fri, 26 Aug 2005 19:28:58 +0000 (19:28 +0000)
git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/simgrid/simgrid/trunk@1670 48e7efb5-ca39-0410-a469-dd3cf9ba447f

src/msg/gos.c

index 8a74d0f..ae67680 100644 (file)
@@ -67,6 +67,7 @@ MSG_error_t MSG_task_get_with_time_out(m_task_t * task,
   e_surf_action_state_t state = SURF_ACTION_NOT_IN_THE_SYSTEM;
   
   CHECK_HOST();
   e_surf_action_state_t state = SURF_ACTION_NOT_IN_THE_SYSTEM;
   
   CHECK_HOST();
+  xbt_assert1((channel>=0) && (channel < msg_global->max_channel),"Invalid channel %d",channel);
   /* Sanity check */
   xbt_assert0(task,"Null pointer for the task\n");
 
   /* Sanity check */
   xbt_assert0(task,"Null pointer for the task\n");
 
@@ -164,6 +165,7 @@ int MSG_task_Iprobe(m_channel_t channel)
   m_host_t h = NULL;
   simdata_host_t h_simdata = NULL;
 
   m_host_t h = NULL;
   simdata_host_t h_simdata = NULL;
 
+  xbt_assert1((channel>=0) && (channel < msg_global->max_channel),"Invalid channel %d",channel);
   DEBUG2("Probing on channel %d (%s)", channel,h->name);
   CHECK_HOST();
   h = MSG_host_self();
   DEBUG2("Probing on channel %d (%s)", channel,h->name);
   CHECK_HOST();
   h = MSG_host_self();
@@ -187,6 +189,7 @@ int MSG_task_probe_from(m_channel_t channel)
   xbt_fifo_item_t item;
   m_task_t t;
 
   xbt_fifo_item_t item;
   m_task_t t;
 
+  xbt_assert1((channel>=0) && (channel < msg_global->max_channel),"Invalid channel %d",channel);
   CHECK_HOST();
   h = MSG_host_self();
   h_simdata = h->simdata;
   CHECK_HOST();
   h = MSG_host_self();
   h_simdata = h->simdata;
@@ -210,6 +213,7 @@ MSG_error_t MSG_channel_select_from(m_channel_t channel, double max_duration,
   int first_time = 1;
   m_process_t process = MSG_process_self();
 
   int first_time = 1;
   m_process_t process = MSG_process_self();
 
+  xbt_assert1((channel>=0) && (channel < msg_global->max_channel),"Invalid channel %d",channel);
   if(PID) {
     *PID = -1;
   }
   if(PID) {
     *PID = -1;
   }
@@ -288,6 +292,8 @@ MSG_error_t MSG_task_put(m_task_t task,
 
   CHECK_HOST();
 
 
   CHECK_HOST();
 
+  xbt_assert1((channel>=0) && (channel < msg_global->max_channel),"Invalid channel %d",channel);
+
   task_simdata = task->simdata;
   task_simdata->sender = process;
   xbt_assert0(task_simdata->using==1,"Gargl!");
   task_simdata = task->simdata;
   task_simdata->sender = process;
   xbt_assert0(task_simdata->using==1,"Gargl!");