linker: Use foreach_list_safe in move_non_declarations

The node being processed may be removed from the list and put in a
different list.  Not using the safe version caused list processing to
change streams after moving a node.
This commit is contained in:
Ian Romanick
2010-07-19 12:34:56 -07:00
parent 9303e358cb
commit 303c99f12f

View File

@@ -543,7 +543,7 @@ exec_node *
move_non_declarations(exec_list *instructions, exec_node *last, move_non_declarations(exec_list *instructions, exec_node *last,
bool make_copies, gl_shader *target) bool make_copies, gl_shader *target)
{ {
foreach_list(node, instructions) { foreach_list_safe(node, instructions) {
ir_instruction *inst = (ir_instruction *) node; ir_instruction *inst = (ir_instruction *) node;
if (inst->as_variable() || inst->as_function()) if (inst->as_variable() || inst->as_function())