diff options
| author | 2022-10-10 11:21:21 +0200 | |
|---|---|---|
| committer | 2022-10-10 11:21:21 +0200 | |
| commit | fd92b1f891167e110cfd2d7ec85b5c53d5c586c1 (patch) | |
| tree | ca15131af23b697f2a56ecf6e9a72f887d092d9e /pez.c | |
| parent | 124972dd5216da7935cf3a928bf6d94e4d6ce833 (diff) | |
bug fixes
Diffstat (limited to 'pez.c')
| -rw-r--r-- | pez.c | 15 |
1 files changed, 11 insertions, 4 deletions
@@ -475,14 +475,21 @@ delproto(PezContext *cx, Proto *pr) } static void -closeups(PezContext *cx, Val *vals) +closeups(PezContext *cx, Val *ptr) { - for (Upval *up = cx->openup, *next; up; up = next) { + for (Upval *up = cx->openup, *prev = NULL, *next; up; up = next) { next = up->nextup; - if (up->ptr >= vals) { - cx->openup = next; + if (up->ptr >= ptr) { + if (prev) { + prev->nextup = next; + } + if (up == cx->openup) { + cx->openup = next; + } up->slot = *up->ptr; up->ptr = &up->slot; + } else { + prev = up; } } } |