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

Maurizio Cimadamore mcimadamore at openjdk.java.net
Fri Dec 17 15:29:11 UTC 2021


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.

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

Commit messages:
 - Fix type translator to support _Bool

Changes: https://git.openjdk.java.net/panama-foreign/pull/627/files
 Webrev: https://webrevs.openjdk.java.net/?repo=panama-foreign&pr=627&range=00
  Issue: https://bugs.openjdk.java.net/browse/JDK-8278962
  Stats: 36 lines in 4 files changed: 8 ins; 18 del; 10 mod
  Patch: https://git.openjdk.java.net/panama-foreign/pull/627.diff
  Fetch: git fetch https://git.openjdk.java.net/panama-foreign pull/627/head:pull/627

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


More information about the panama-dev mailing list