RFR: 8342682: Errors related to unused code on Windows after 8339120 in dt_shmem jdwp security and jpackage
Chris Plummer
cjplummer at openjdk.org
Wed Oct 23 16:54:10 UTC 2024
On Wed, 23 Oct 2024 05:22:45 GMT, Julian Waters <jwaters at openjdk.org> wrote:
>> src/jdk.jdi/windows/native/libdt_shmem/shmem_md.c line 47:
>>
>>> 45: {
>>> 46: void *mappedMemory;
>>> 47: // HANDLE memHandle;
>>
>> Why comment out this one but not the one at line 88? It seems they are both equally problematic and are hiding the static memHandle. I'm not sure why the 2nd one isn't flagged. I'd actually suggest getting rid of the static memHandle. It does not seem to be needed.
>
> I wasn't sure whether the global memHandle not being used was a bug, so I commented out the local one. I missed the line 88 one because it wasn't flagged. If it really isn't needed I'll remove that one instead
I'm not sure what you mean by "that one". It's the static one that should be removed. The local variables always hide the static, and there seems to be no reason for the value of memHandle to survive outside of the local scope it is used in.
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/21616#discussion_r1813181393
More information about the serviceability-dev
mailing list