Skip to content

Commit

Permalink
c11_atomics: fix uninitialized member accesses
Browse files Browse the repository at this point in the history
Initialize the `_memoryOrder` and `_memoryScope` members to avoid
`CBasicTestMemOrderScope::MaxHostThreads()` accessing uninitialized
data.

Signed-off-by: Sven van Haastregt <[email protected]>
  • Loading branch information
svenvh committed Sep 25, 2023
1 parent b143a99 commit 9290aae
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions test_conformance/c11_atomics/common.h
Original file line number Diff line number Diff line change
Expand Up @@ -644,8 +644,8 @@ class CBasicTestMemOrderScope
}

private:
TExplicitMemoryOrderType _memoryOrder;
TExplicitMemoryScopeType _memoryScope;
TExplicitMemoryOrderType _memoryOrder = MEMORY_ORDER_EMPTY;
TExplicitMemoryScopeType _memoryScope = MEMORY_SCOPE_EMPTY;
};

template <typename HostAtomicType, typename HostDataType>
Expand Down

0 comments on commit 9290aae

Please sign in to comment.