mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2025-12-24 21:50:12 +01: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
1 changed files with 2 additions and 2 deletions
|
|
@ -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…
Add table
Reference in a new issue