-
Bug
-
Resolution: Won't Fix
-
P4
-
None
-
26
-
None
-
generic
-
linux
When using the gcc static analyzer (fanalyzer) with gcc 13.2, the following issue is reported :
jdk/src/jdk.management/share/native/libmanagement_ext/GcInfoBuilder.c:296:20: warning: check of 'gc_stat.gc_ext_attribute_values' for NULL after already dereferencing it [-Wanalyzer-deref-before-check]
296 | if (gc_stat.gc_ext_attribute_values != NULL) {
Indeed we use a few line above
https://github.com/openjdk/jdk/blob/1d53ac30f1db88df9a97b63b3ff56d26975d3a57/src/jdk.management/share/native/libmanagement_ext/GcInfoBuilder.c#L269
already the value with NULL check, so we should align the usage of NULL checks in the Java_com_sun_management_internal_GcInfoBuilder_getLastGcInfo0 function .
jdk/src/jdk.management/share/native/libmanagement_ext/GcInfoBuilder.c:296:20: warning: check of 'gc_stat.gc_ext_attribute_values' for NULL after already dereferencing it [-Wanalyzer-deref-before-check]
296 | if (gc_stat.gc_ext_attribute_values != NULL) {
Indeed we use a few line above
https://github.com/openjdk/jdk/blob/1d53ac30f1db88df9a97b63b3ff56d26975d3a57/src/jdk.management/share/native/libmanagement_ext/GcInfoBuilder.c#L269
already the value with NULL check, so we should align the usage of NULL checks in the Java_com_sun_management_internal_GcInfoBuilder_getLastGcInfo0 function .
- relates to
-
JDK-8362516 Support of GCC static analyzer (-fanalyzer)
-
- Resolved
-