RFR: 7903715: Jextract generates duplicate allocator parameters

Jorn Vernee jvernee at openjdk.org
Thu Apr 18 12:46:21 UTC 2024


On Thu, 18 Apr 2024 10:42:31 GMT, Maurizio Cimadamore <mcimadamore at openjdk.org> wrote:

> This simple fix addresses a case where jextract generates two function parameter with duplicate name `allocator`.

Marked as reviewed by jvernee (Committer).

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?

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

PR Review: https://git.openjdk.org/jextract/pull/238#pullrequestreview-2008785004
PR Review Comment: https://git.openjdk.org/jextract/pull/238#discussion_r1570659435


More information about the jextract-dev mailing list