[foreign-jextract] RFR: 8278962: Support for _Bool not working correctly

Athijegannathan Sundararajan sundar at openjdk.java.net
Fri Dec 17 15:29:11 UTC 2021


On Fri, 17 Dec 2021 15:17:53 GMT, Maurizio Cimadamore <mcimadamore at openjdk.org> wrote:

> TypeTranslator does not deal with _Bool layout correctly. Instead of turning it into the `boolean.class` carrier, it turns it into a `byte.class` carrier. This is caused by the fact that we still have some old logic for deriving carriers from layouts which does not take into account the fact that the carrier is now attached to the layout.
> 
> Fixing this breaks the macro `ConstantTest` - as one `_Bool` constant is not generated correctly. Again the solution is to take the `_Bool` case into account when reparsing a macro, so that we can generate a macro whose value is a Boolean, not just a numeric value.

LGTM

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

Marked as reviewed by sundar (Committer).

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


More information about the panama-dev mailing list