Skip to content

Commit

Permalink
Merge pull request #417 from kevcadieux/test-allocator-fix
Browse files Browse the repository at this point in the history
Fixing stack-use-after-scope ASan error detected in the [Allocator] test
  • Loading branch information
liam-mitchell authored Jul 16, 2021
2 parents b369a75 + feb6282 commit 95b281e
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion test/source/TestAllocator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,6 @@ static int TestFixedAllocator()
typedef eastl::list<int, fixed_allocator_with_overflow> IntList;
typedef IntList::node_type IntListNode;

IntList intList1;
const size_t kAlignOfIntListNode = EA_ALIGN_OF(IntListNode);

// ensure the fixed buffer contains the default value that will be replaced
Expand All @@ -140,6 +139,8 @@ static int TestFixedAllocator()
EATEST_VERIFY(buffer1[i].mValue == DEFAULT_VALUE);
}

IntList intList1;

// replace all the values in the local buffer with the test value
intList1.get_allocator().init(buffer1, sizeof(buffer1), sizeof(IntListNode), kAlignOfIntListNode);
for (size_t i = 0; i < kBufferCount; i++)
Expand Down

0 comments on commit 95b281e

Please sign in to comment.