]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Loops: copy reference to next entity before entering lambda 343/head
authorTimePath <andrew.hardaker1995@gmail.com>
Wed, 27 Jul 2016 12:14:53 +0000 (22:14 +1000)
committerTimePath <andrew.hardaker1995@gmail.com>
Wed, 27 Jul 2016 12:14:53 +0000 (22:14 +1000)
qcsrc/lib/iter.qh

index c21d02121347d34b79042a31809ccd421693ab3f..82448b931bed86c3788be433ea8fd9588b130145 100644 (file)
        MACRO_BEGIN \
        { \
                int _i = 0; \
-               for (entity _it = list##_first; _it; (_it = _it.next, ++_i)) \
+               for (entity _it = list##_first, _next = NULL; _it; (_it = _next, ++_i)) \
                { \
                        const noref int i = _i; \
                        ITER_CONST noref entity it = _it; \
+                       _next = _it.next; \
                        if (cond) { LAMBDA(body) } \
                } \
        } MACRO_END