RFR: 8314265: Fix -Wconversion warnings in miscellaneous runtime code [v4]
Coleen Phillimore
coleenp at openjdk.org
Wed Aug 16 23:08:08 UTC 2023
On Wed, 16 Aug 2023 21:38:52 GMT, Dean Long <dlong at openjdk.org> wrote:
>> Coleen Phillimore has updated the pull request incrementally with one additional commit since the last revision:
>>
>> Remove wrong comment.
>
> src/hotspot/share/utilities/elfFile.cpp line 1723:
>
>> 1721: void DwarfFile::LineNumberProgram::LineNumberProgramState::set_index_register(const uint64_t operation_advance,
>> 1722: const LineNumberProgramHeader& header) {
>> 1723: _op_index = (_op_index + operation_advance) % header._maximum_operations_per_instruction;
>
> This should be narrowed by a byte.
So put the cast here?
> src/hotspot/share/utilities/elfFile.hpp line 790:
>
>> 788: // The address and op_index registers, taken together, form an operation pointer that can reference any
>> 789: // individual operation with the instruction stream. This field was introduced with DWARF 4.
>> 790: uint64_t _op_index;
>
> This can be uint8_t, because it can never be larger than _maximum_operations_per_instruction, which is also a byte.
This was windened as a result of a conversion warning, so I'd have to add a cast somewhere.
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/15233#discussion_r1296518068
PR Review Comment: https://git.openjdk.org/jdk/pull/15233#discussion_r1296517769
More information about the build-dev
mailing list