Skip to content

Commit

Permalink
memslot: Fix a bug of memslot_move()
Browse files Browse the repository at this point in the history
Invoking memslot_init() in memslot_move() will result in losing the
linked list information of the original memory slot node. Reimplement
memslot_move() to resolve some exceptional issues during mapping memory
slots.

Signed-off-by: leecher1337 <[email protected]>
(cherry picked from commit e1e9c97)
  • Loading branch information
leecher1337 authored and jarveson committed Dec 12, 2019
1 parent c088181 commit b66837d
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion core/memslot.c
Original file line number Diff line number Diff line change
Expand Up @@ -380,7 +380,9 @@ static inline void memslot_delete(hax_memslot *dest)
static inline void memslot_move(hax_memslot *dest, hax_memslot *src)
{
ramblock_deref(dest->block);
memslot_init(dest, src);
src->entry = dest->entry;
*dest = *src;
ramblock_ref(dest->block);
}

static inline void memslot_union(hax_memslot *dest, hax_memslot *src)
Expand Down

0 comments on commit b66837d

Please sign in to comment.