From c31060f0b899303fb326b15abb1fe0b22398b8eb Mon Sep 17 00:00:00 2001 From: Michael Scire Date: Wed, 29 Sep 2021 23:56:30 -0700 Subject: [PATCH] lmem: fix assert with side effects --- .../libstratosphere/source/lmem/impl/lmem_impl_exp_heap.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/libraries/libstratosphere/source/lmem/impl/lmem_impl_exp_heap.cpp b/libraries/libstratosphere/source/lmem/impl/lmem_impl_exp_heap.cpp index 3119a3039..a7b535aa4 100644 --- a/libraries/libstratosphere/source/lmem/impl/lmem_impl_exp_heap.cpp +++ b/libraries/libstratosphere/source/lmem/impl/lmem_impl_exp_heap.cpp @@ -462,7 +462,11 @@ namespace ams::lmem::impl { /* Erase the heap from the used list, and coalesce it with adjacent blocks. */ GetMemoryBlockRegion(®ion, block); exp_heap_head->used_list.erase(exp_heap_head->used_list.iterator_to(*block)); - AMS_ASSERT(CoalesceFreedRegion(exp_heap_head, ®ion)); + + /* Coalesce with adjacent blocks. */ + const bool coalesced = CoalesceFreedRegion(exp_heap_head, ®ion); + AMS_ASSERT(coalesced); + AMS_UNUSED(coalesced); } size_t ResizeExpHeapMemoryBlock(HeapHandle handle, void *mem_block, size_t size) {