]> rtime.felk.cvut.cz Git - ulut.git/commitdiff
Use va_copy if va_list is used twice, else bad things happen on X86_64 systems.
authorppisa <ppisa>
Mon, 20 Oct 2008 08:41:51 +0000 (08:41 +0000)
committerppisa <ppisa>
Mon, 20 Oct 2008 08:41:51 +0000 (08:41 +0000)
The arguments pointer is eaten by its use in destination function
and it is unusable next time. The separate copy has to be used for each call.

ulut/ul_evcbase.c

index 353b6e4c16b0f7b1520170492fefee505fd1de99..d3884b9f1c15480ac97c0af6a56cd5f7cfb4bc5d 100644 (file)
@@ -290,7 +290,10 @@ void evc_tx_hub_propagate(evc_tx_hub_t *hub, va_list args)
   evc_link_inc_refcnt(link);   /*prevents dispose of the link*/
   link->taken++;               /*prevents delete of the link from the hub*/
   do{
-    link->propagate(link, args);
+    va_list args_copy;
+    va_copy(args_copy, args);
+    link->propagate(link, args_copy);
+    va_end(args_copy);
 
     if(link->src.hub == hub){  /*check for correct hub relation*/
       next=link;