diff --git a/ConflictSet.cpp b/ConflictSet.cpp index a718baa..67b914e 100644 --- a/ConflictSet.cpp +++ b/ConflictSet.cpp @@ -250,11 +250,12 @@ struct TaggedNodePointer { /*implicit*/ TaggedNodePointer(Node *n); private: - TaggedNodePointer(struct Node *p, Type) : p((uintptr_t)p) { + TaggedNodePointer(struct Node *p, Type t) : p((uintptr_t)p) { assert((this->p & 7) == 0); + this->p |= t; assume(p != 0); } - uintptr_t withoutType() const { return p; } + uintptr_t withoutType() const { return p & ~uintptr_t(7); } uintptr_t p; }; @@ -288,7 +289,7 @@ TaggedNodePointer::TaggedNodePointer(Node *n) Type TaggedNodePointer::getType() { assert(p != 0); - return ((Node *)p)->getType(); + return Type(p & uintptr_t(7)); } constexpr int kNodeCopyBegin = offsetof(Node, entry);