Skip to content

Commit

Permalink
Only prune extra args as our instructions can add missing ones for in…
Browse files Browse the repository at this point in the history
…ternal block calling
  • Loading branch information
enebo committed Dec 7, 2016
1 parent 179099c commit 9afc357
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion core/src/main/java/org/jruby/runtime/CallBlock.java
Expand Up @@ -61,7 +61,7 @@ private CallBlock(Signature signature, BlockCallback callback, ThreadContext con
private IRubyObject[] adjustArgs(Block block, IRubyObject[] args) {
Signature signature = block.getSignature();
int required = signature.required();
if (signature.isFixed() && required > 0 && required != args.length) args = ArraySupport.newCopy(args, required);
if (signature.isFixed() && required > 0 && required < args.length) args = ArraySupport.newCopy(args, required);

return args;
}
Expand Down
Expand Up @@ -50,7 +50,7 @@ private void threadCheck(ThreadContext yieldingContext) {
private IRubyObject[] adjustArgs(Block block, IRubyObject[] args) {
Signature signature = block.getSignature();
int required = signature.required();
if (signature.isFixed() && required > 0 && required != args.length) args = ArraySupport.newCopy(args, required);
if (signature.isFixed() && required > 0 && required < args.length) args = ArraySupport.newCopy(args, required);

return args;
}
Expand Down

0 comments on commit 9afc357

Please sign in to comment.