RFR: 7903715: Jextract generates duplicate allocator parameters

Maurizio Cimadamore mcimadamore at openjdk.org
Thu Apr 18 13:09:07 UTC 2024


On Thu, 18 Apr 2024 12:44:04 GMT, Jorn Vernee <jvernee at openjdk.org> wrote:

>> This simple fix addresses a case where jextract generates two function parameter with duplicate name `allocator`.
>
> src/main/java/org/openjdk/jextract/impl/HeaderFileBuilder.java line 135:
> 
>> 133:             String allocatorName = "allocator";
>> 134:             while (result.contains(allocatorName)) {
>> 135:                 allocatorName = "_" + allocatorName;
> 
> In other places we've used `$` suffixes to deconflict names. Should we do the same here?

I did this because the name mangler uses `_` when a name is a keyword e.g. `var`.

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

PR Review Comment: https://git.openjdk.org/jextract/pull/238#discussion_r1570706179


More information about the jextract-dev mailing list