From 07112682c6c841217644b44d5229756376ff0549 Mon Sep 17 00:00:00 2001 From: Gary Talent Date: Sun, 17 Mar 2019 22:39:20 -0500 Subject: [PATCH] [ox/ptrarith] Fix compact not to cycle back to start --- deps/ox/src/ox/ptrarith/nodebuffer.hpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/deps/ox/src/ox/ptrarith/nodebuffer.hpp b/deps/ox/src/ox/ptrarith/nodebuffer.hpp index 8b0720df..980a53b2 100644 --- a/deps/ox/src/ox/ptrarith/nodebuffer.hpp +++ b/deps/ox/src/ox/ptrarith/nodebuffer.hpp @@ -329,7 +329,7 @@ template void NodeBuffer::compact(F cb) { auto src = firstItem(); auto dest = ptr(sizeof(*this)); - while (src.valid() && dest.valid()) { + while (src.valid() && dest.valid() && dest.offset() < src.offset()) { // move node ox_memcpy(dest, src, src.size()); cb(src, dest);