Skip to content
This repository has been archived by the owner on Jan 28, 2023. It is now read-only.

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 <leecher@dose.0wnz.at>
  • Loading branch information
leecher1337 committed Aug 28, 2019
1 parent 3c85766 commit e1e9c97
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 e1e9c97

Please sign in to comment.