Skip to content
Snippets Groups Projects
Commit 477ee235 authored by Jakub Klinkovský's avatar Jakub Klinkovský
Browse files

Added workaround for a bug in GCC 12 to SharedPointerHost.h

parent e1f7fc0f
No related branches found
No related tags found
No related merge requests found
......@@ -440,10 +440,21 @@ protected:
free()
{
if( this->pd ) {
// As far as we know, GCC 12.0.0 and 12.1.0 issue a false-positive use-after-free warning
// These bug reports may be related:
// - https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105327
// - https://bugzilla.redhat.com/show_bug.cgi?id=2047715
#if defined( __GNUC__ ) && ! defined( __clang__ ) && ! defined( __NVCC__ )
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wuse-after-free"
#endif
if( ! --this->pd->counter ) {
delete this->pd;
this->pd = nullptr;
}
#if defined( __GNUC__ ) && ! defined( __clang__ ) && ! defined( __NVCC__ )
#pragma GCC diagnostic pop
#endif
}
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment