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

Linker should reject invalid firstVariadicArg option

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Not an Issue
    • Icon: P3 P3
    • None
    • 21
    • core-libs
    • None

      Linker.nativeLinker().downcallHandle(
              Linker.nativeLinker().defaultLookup().find("printf").get(),
              FunctionDescriptor.of(JAVA_INT, ADDRESS, JAVA_INT, JAVA_INT, JAVA_INT),
              Linker.Option.firstVariadicArg(4)
      );

      Here argument index 4 is invalid for the given function descriptor. Hence expect IllegalArgumentException to be thrown, but is not thrown.

      When tried with index 5, exception is thrown indeed.

            jvernee Jorn Vernee
            pgundarlahal Prashanthram Gundarlahally
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: