mirror of
https://github.com/openjdk/jdk.git
synced 2025-08-28 15:24:43 +02:00
8186646: Nashorn: "duplicate code" assertion when binding a vararg function that just passes arguments along
Reviewed-by: sundar, jlaskey
This commit is contained in:
parent
0f4c864067
commit
9ddbf8fde2
2 changed files with 42 additions and 0 deletions
|
@ -537,6 +537,9 @@ final class CompiledFunction {
|
|||
|
||||
final int csParamCount = getParamCount(other);
|
||||
final boolean csIsVarArg = csParamCount == Integer.MAX_VALUE;
|
||||
if (csIsVarArg && isApplyToCall()) {
|
||||
return false; // apply2call function must be called with exact number of parameters
|
||||
}
|
||||
final int thisThisIndex = needsCallee() ? 1 : 0; // Index of "this" parameter in this function's type
|
||||
|
||||
final int fnParamCountNoCallee = fnParamCount - thisThisIndex;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue