Skip to content

Commit

Permalink
Clear callInfo in this block body
Browse files Browse the repository at this point in the history
Enumerable#to_a does not take keywords but also was not handling
any incoming callInfo bits. As a result an incoming
CALL_KEYWORD_EMPTY bit can get stuck and propagte through to the
next call. This does not process any kwargs because it is
effectively a block with signature like |a, *b| but whether it
should do more than clearing callInfo is unknown.

Fixes jruby#8382
  • Loading branch information
headius committed Oct 28, 2024
1 parent feb5fb7 commit 79c30a1
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions core/src/main/java/org/jruby/RubyEnumerable.java
Original file line number Diff line number Diff line change
Expand Up @@ -2302,12 +2302,14 @@ public AppendBlockCallback(Ruby runtime, RubyArray result) {
}

public IRubyObject call(ThreadContext context, IRubyObject[] args, Block block) {
ThreadContext.resetCallInfo(context);
result.append(packEnumValues(context, args));
return context.nil;
}

@Override
public IRubyObject call(ThreadContext context, IRubyObject arg, Block block) {
ThreadContext.resetCallInfo(context);
result.append(arg);
return context.nil;
}
Expand Down

0 comments on commit 79c30a1

Please sign in to comment.