From 672665dec001edae90fd1dcfdc94a0a54585c4bf Mon Sep 17 00:00:00 2001 From: Lioncash Date: Sun, 1 Apr 2018 19:01:55 -0400 Subject: AsyncRequests: In-class initialize class members Prior to this change, it's possible for m_wake_me_up_again to be used while it's in an uninitialized state from the exposed API. e.g. - Using SetEnable after construction would perform an uninitialized read. - Using PushEvent would perform an uninitialized read by way of operator |=. internally, an uninitialized read can happen if PullEventsInternal() is executed before other functions. Just to avoid the whole possibility of performing uninitialized reads, we just give the class member a default value of false. --- Source/Core/VideoCommon/AsyncRequests.cpp | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'Source/Core/VideoCommon/AsyncRequests.cpp') diff --git a/Source/Core/VideoCommon/AsyncRequests.cpp b/Source/Core/VideoCommon/AsyncRequests.cpp index f41354730d..cab79c8bc2 100644 --- a/Source/Core/VideoCommon/AsyncRequests.cpp +++ b/Source/Core/VideoCommon/AsyncRequests.cpp @@ -12,9 +12,7 @@ AsyncRequests AsyncRequests::s_singleton; -AsyncRequests::AsyncRequests() : m_enable(false), m_passthrough(true) -{ -} +AsyncRequests::AsyncRequests() = default; void AsyncRequests::PullEventsInternal() { -- cgit v1.2.3