[jdk18] RFR: 8272058: 25 Null pointer dereference defect groups in 4 files [v4]

Dean Long dlong at openjdk.java.net
Wed Jan 19 10:00:32 UTC 2022


On Thu, 13 Jan 2022 21:13:04 GMT, Daniel D. Daugherty <dcubed at openjdk.org> wrote:

>> A small refactoring to resolve a Parfait complaint about the return value from
>> `MacroAssembler::target_addr_for_insn(address insn_addr, unsigned insn)`
>> on AARCH64. The logic that supports returning `nullptr` as the target addr for
>> a particular instruction is moved from
>> `MacroAssembler::target_addr_for_insn(address insn_addr, unsigned insn)` to
>> `MacroAssembler::target_addr_for_insn_allow_null_ret(address insn_addr, unsigned insn)`.
>> A couple of `target_addr_for_insn()` call sites that can tolerate a `nullptr` are
>> converted to use `target_addr_for_insn_allow_null_ret()`.
>> 
>> This fix has been tested with Mach5 Tier[1-3].
>
> Daniel D. Daugherty has updated the pull request with a new target base due to a merge or a rebase. The incremental webrev excludes the unrelated changes brought in by the merge/rebase. The pull request contains five additional commits since the last revision:
> 
>  - copyright updates for 2022.
>  - Merge branch 'master' into JDK-8272058
>  - bulasevich CR - use NativeInstruction::is_ldrw_to_zr() instead of raw constants.
>  - Merge branch 'master' into JDK-8272058
>  - 8272058.exp1.patch

Marked as reviewed by dlong (Reviewer).

src/hotspot/cpu/aarch64/macroAssembler_aarch64.hpp line 610:

> 608:   static address target_addr_for_insn(address insn_addr, unsigned insn);
> 609:   static address target_addr_for_insn_allow_null_ret(address insn_addr, unsigned insn);
> 610:   static address target_addr_for_insn(address insn_addr) {

The or_null suffix that we use in shared code reads a little better to me.

-------------

PR: https://git.openjdk.java.net/jdk18/pull/51


More information about the hotspot-compiler-dev mailing list