Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: jruby/jruby
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 30e99a0c58c8
Choose a base ref
...
head repository: jruby/jruby
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: c6a03e440079
Choose a head ref
  • 2 commits
  • 2 files changed
  • 1 contributor

Commits on Dec 19, 2015

  1. Copy the full SHA
    e9fde7a View commit details
  2. Copy the full SHA
    c6a03e4 View commit details
Original file line number Diff line number Diff line change
@@ -52,8 +52,8 @@ private void popSavedState(IRScope scope, boolean isGEB, boolean requireBinding,
}
if (requireBinding) instrs.add(new PopBindingInstr());
if (scope instanceof IRClosure) {
instrs.add(new PopBlockFrameInstr(savedFrame));
instrs.add(new RestoreBindingVisibilityInstr(savedViz));
instrs.add(new PopBlockFrameInstr(savedFrame));
} else {
if (requireFrame) instrs.add(new PopMethodFrameInstr());
}
9 changes: 6 additions & 3 deletions core/src/main/java/org/jruby/ir/runtime/IRRuntimeHelpers.java
Original file line number Diff line number Diff line change
@@ -1535,8 +1535,11 @@ private static IRubyObject[] prepareBlockArgsInternal(ThreadContext context, Blo

BlockBody body = block.getBody();
org.jruby.runtime.Signature sig = body.getSignature();
if (sig.arityValue() == -1 || sig.required() == 1) {
if (isLambda) block.getBody().getSignature().checkArity(context.runtime, args);
int arityValue = sig.arityValue();
if (isLambda && (arityValue == -1 || sig.required() == 1)) {
block.getBody().getSignature().checkArity(context.runtime, args);
return args;
} else if (!isLambda && arityValue >= -1 && arityValue <= 1) {
return args;
}

@@ -1623,7 +1626,7 @@ public static IRubyObject[] prepareFixedBlockArgs(ThreadContext context, Block b
}

// SSS FIXME: This check here is not required as long as
// the single-instruction cases always uses PreapreSingleBlockArgInstr
// the single-instruction cases always uses PrepareSingleBlockArgInstr
// But, including this here for robustness for now.
if (block.getBody().getSignature().arityValue() == 1) {
return args;