[Mesa-dev] exec_list question

Timothy Arceri t_arceri at yahoo.com.au
Sun Jan 12 00:08:49 PST 2014


Hi Guys,

I've been chasing my tail most of the afternoon using exec_list
basically I was just trying to copy all but the first element from one
list to another using the code bellow. 

            exec_list *copy_dims =
&type->array_specifier->array_dimensions;
            int i = 0;
            //TODO: has to be better way to copy all dimension but the
first one
            foreach_list (node, copy_dims) {
               if(i>0)
                  array_specifier->array_dimensions.push_tail(node);
               i++;
            }

But when doing this the last element from the list I was coping FROM was
somehow being lost.

Replacing foreach_list with foreach_list_safe seems to have fixed the
problem. However I don't really understand why is someone able to
explain to me what's happening here?




More information about the mesa-dev mailing list