From 4d6da3dd69efad9532f55deadcbb25efadde1dc3 Mon Sep 17 00:00:00 2001 From: Leonardo de Moura Date: Tue, 28 Aug 2018 10:30:51 -0700 Subject: [PATCH] fix(runtime/compact): bug at `read` --- src/runtime/compact.cpp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/runtime/compact.cpp b/src/runtime/compact.cpp index 50191f871a..d69c83d641 100644 --- a/src/runtime/compact.cpp +++ b/src/runtime/compact.cpp @@ -280,9 +280,8 @@ object * compacted_region::read() { lean_assert(static_cast(m_next) + sizeof(object) <= m_end); object * curr = reinterpret_cast(m_next); if (curr->m_kind == TERMINATOR_ID) { - move(sizeof(object)); - object * r = *static_cast(m_next); - move(sizeof(object*)); + object * r = *reinterpret_cast(static_cast(m_next) + sizeof(object)); + move(sizeof(object) + sizeof(object*)); return fix_object_ptr(r); } else { switch (get_kind(curr)) {