Linux: Quench/fix some gcc warnings, unsure how genuine they are at this point.

master
Zi Ree 2023-03-26 15:51:50 +02:00
parent 88d6791ff1
commit 90e8853948
3 changed files with 43 additions and 4 deletions

View File

@ -866,11 +866,21 @@ BOOL LLImageGL::setImage(const U8* data_in, BOOL data_hasmips /* = FALSE */, S32
{
stop_glerror();
if (prev_mip_data)
// <FS:Zi> Fix use-after-free
// if (prev_mip_data)
// delete[] prev_mip_data;
// if (cur_mip_data)
// delete[] cur_mip_data;
if (prev_mip_data != cur_mip_data)
{
delete[] prev_mip_data;
if (cur_mip_data)
delete[] cur_mip_data;
}
delete[] cur_mip_data;
prev_mip_data = nullptr;
cur_mip_data = nullptr;
// </FS:Zi>
//
mGLTextureCreated = false;
return FALSE;
}

View File

@ -2211,7 +2211,18 @@ BOOL LLFace::getGeometryVolume(const LLVolume& volume,
while (dst < end_f32)
{
// <FS:Zi> GCC12 warning: maybe-uninitialized - probably bogus
#if defined(__GNUC__) && (__GNUC__ >= 12)
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wmaybe-uninitialized"
#endif
// </FS:Zi>
res0.store4a((F32*) dst);
// <FS:Zi> GCC12 warning: maybe-uninitialized - probably bogus
#if defined(__GNUC__) && (__GNUC__ >= 12)
#pragma GCC diagnostic pop
#endif
// </FS:Zi>
dst += 4;
}
@ -2262,7 +2273,18 @@ BOOL LLFace::getGeometryVolume(const LLVolume& volume,
while (src < end)
{
LLVector4a tangent_out;
// <FS:Zi> GCC12 warning: maybe-uninitialized - probably bogus
#if defined(__GNUC__) && (__GNUC__ >= 12)
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wmaybe-uninitialized"
#endif
// </FS:Zi>
mat_normal.rotate(*src, tangent_out);
// <FS:Zi> GCC12 warning: maybe-uninitialized - probably bogus
#if defined(__GNUC__) && (__GNUC__ >= 12)
#pragma GCC diagnostic pop
#endif
// </FS:Zi>
tangent_out.normalize3fast();
tangent_out.setSelectWithMask(mask, *src, tangent_out);
tangent_out.store4a(tangents);

View File

@ -496,6 +496,13 @@ private:
mFetchedSize(f_size),
mDecodedSize(d_size),
mNeedsAux(false),
// <FS:Zi> gcc12: -Werror=maybe-uninitialized
#if defined(__GNUC__) && (__GNUC__ >= 12)
mCacheHandle(0),
mCurlState(CURL_NOT_DONE),
mCurlReceivedSize(0),
#endif
// </FS:Zi>
mHttpHandle(LLCORE_HTTP_HANDLE_INVALID)
{}
};