[foreign-abi] RFR: 8240173: Confusing overflow error when trying to dereference a nothing segment

Paul Sandoz psandoz at openjdk.java.net
Thu Feb 27 17:37:34 UTC 2020


On Thu, 27 Feb 2020 12:40:08 GMT, Maurizio Cimadamore <mcimadamore at openjdk.org> wrote:

> This simple patch attempts to generate a more explicit error message when trying to dereference an address which is based on the Nothing segment. Note that the first problem here is caused by the fact that the Nothing segment is considered "small" - which means most of the real address values will fall outside its range. While we could simply fix that (which will improve the error message - from reporting an overflow during offset computation to report an access outside the bounds of the segment), I thought it was better to mark the Nothing segment as non-accessible, and generate an explicit error message.

Suggest changing the error message to something like segment cannot be accessed rather than dereferenced?

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

Marked as reviewed by psandoz (Committer).

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


More information about the panama-dev mailing list