mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2024-12-05 00:05:25 +08:00
gtest: Fix maybe-uninitialized compiler warning
This is a cherry-pick from upstream - 4679637f ("Fix warning maybe-uninitialized"). Signed-off-by: Christian Gmeiner <christian.gmeiner@gmail.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17121>
This commit is contained in:
parent
d06335ed76
commit
828793cb82
@ -1288,7 +1288,7 @@ static void StackLowerThanAddress(const void* ptr,
|
||||
// making comparison result unpredictable.
|
||||
GTEST_ATTRIBUTE_NO_SANITIZE_HWADDRESS_
|
||||
static void StackLowerThanAddress(const void* ptr, bool* result) {
|
||||
int dummy;
|
||||
int dummy = 0;
|
||||
*result = (&dummy < ptr);
|
||||
}
|
||||
|
||||
@ -1296,7 +1296,7 @@ static void StackLowerThanAddress(const void* ptr, bool* result) {
|
||||
GTEST_ATTRIBUTE_NO_SANITIZE_ADDRESS_
|
||||
GTEST_ATTRIBUTE_NO_SANITIZE_HWADDRESS_
|
||||
static bool StackGrowsDown() {
|
||||
int dummy;
|
||||
int dummy = 0;
|
||||
bool result;
|
||||
StackLowerThanAddress(&dummy, &result);
|
||||
return result;
|
||||
|
Loading…
Reference in New Issue
Block a user