Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8289333

Specification of method j.l.foreign.VaList::skip deserves clarification

    XMLWordPrintable

Details

    • Bug
    • Status: Resolved
    • P3
    • Resolution: Fixed
    • 19
    • 19
    • core-libs

    Backports

      Description

        Specificaition of method VaList::skip is rather short

        > Skips a number of elements with the given memory layouts, and advances this variable argument list's position.

        It's not perfectly clear what would for example produce the following code

                try (var session = MemorySession.openConfined()) {
                    VaList vaList = VaList.make(builder -> builder.addVarg(ValueLayout.JAVA_INT, 77)
                            .addVarg(ValueLayout.JAVA_LONG, -78),
                            session);
                    vaList.skip(ValueLayout.JAVA_DOUBLE, ValueLayout.JAVA_BOOLEAN);
                    System.out.println(vaList.nextVarg(ValueLayout.JAVA_INT));
                }

        On MacOS x86 the result is

        -78

        In the OpenJDK implementation behaves correctly, the spec of ::skip would benefit from more detailed explaination or some references or hints.

        Attachments

          Issue Links

            Activity

              People

                jvernee Jorn Vernee
                dbessono Dmitry Bessonov
                Votes:
                0 Vote for this issue
                Watchers:
                5 Start watching this issue

                Dates

                  Created:
                  Updated:
                  Resolved: