[foreign-memaccess+abi] RFR: 8266626: Check that the target address of a native call is not NULL [v3]

Maurizio Cimadamore mcimadamore at openjdk.java.net
Mon May 10 12:13:32 UTC 2021

On Mon, 10 May 2021 11:41:28 GMT, Jorn Vernee <jvernee at openjdk.org> wrote:

>> This patch adds a check when unboxing the target address of a native call to check that the address is not `NULL`. Additionally, it adds checks earlier when an address is specified with a linking request, to check that that address is not `NULL`.
>> I didn't see any regressions on the CallOverhead* benchmarks.
>> Thanks,
>> Jorn
> Jorn Vernee has updated the pull request with a new target base due to a merge or a rebase. The pull request now contains four commits:
>  - Merge branch 'foreign-memaccess+abi' into Check_NULL
>  - - Merge check symbol code
>    - add missing documentation
>  - Add tests
>  - WIP - Add NULL checks for target addresses (need tests)

Looks good - some minor quibbles over javadoc

src/jdk.incubator.foreign/share/classes/jdk/incubator/foreign/CLinker.java line 200:

> 198:      * @return the downcall method handle.
> 199:      * @throws IllegalArgumentException in the case of a method type and function descriptor mismatch, or if the symbol
> 200:      *                                  is {@link MemoryAddress#NULL}

Is the indentation deliberate? What about NPE?


Marked as reviewed by mcimadamore (Committer).

PR: https://git.openjdk.java.net/panama-foreign/pull/530

More information about the panama-dev mailing list