glsl/glcpp: Fix handling of commas that result from macro expansion
[mesa.git] / src / glsl / ir_function_detect_recursion.cpp
index 5813315b613e1cb7528e67e7e674ab1e758f11f6..b2334d2e403316a3cb0c6c820bb012abfc31160b 100644 (file)
@@ -229,15 +229,13 @@ public:
 static void
 destroy_links(exec_list *list, function *f)
 {
-   foreach_list_safe(node, list) {
-      struct call_node *n = (struct call_node *) node;
-
+   foreach_in_list_safe(call_node, node, list) {
       /* If this is the right function, remove it.  Note that the loop cannot
        * terminate now.  There can be multiple links to a function if it is
        * either called multiple times or calls multiple times.
        */
-      if (n->func == f)
-        n->remove();
+      if (node->func == f)
+        node->remove();
    }
 }