Skip to content

Commit 7d60415

Browse files
committed
add a reset after manual change of call-info
1 parent 0215ef9 commit 7d60415

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

core/src/main/java/org/jruby/RubyKernel.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -142,6 +142,7 @@
142142
import static org.jruby.ir.runtime.IRRuntimeHelpers.dupIfKeywordRestAtCallsite;
143143
import static org.jruby.ir.runtime.IRRuntimeHelpers.receiveKeywords;
144144
import static org.jruby.runtime.ThreadContext.hasKeywords;
145+
import static org.jruby.runtime.ThreadContext.hasNonemptyKeywords;
145146
import static org.jruby.runtime.Visibility.PRIVATE;
146147
import static org.jruby.runtime.Visibility.PROTECTED;
147148
import static org.jruby.runtime.Visibility.PUBLIC;
@@ -328,6 +329,7 @@ public static IRubyObject open(ThreadContext context, IRubyObject recv, IRubyObj
328329
if (redirect) {
329330
if (keywords) context.callInfo = ThreadContext.CALL_KEYWORD;
330331
IRubyObject io = args[0].callMethod(context, "to_open", Arrays.copyOfRange(args, 1, args.length));
332+
ThreadContext.resetCallInfo(context);
331333

332334
RubyIO.ensureYieldClose(context, io, block);
333335
return io;
@@ -2091,9 +2093,7 @@ public static IRubyObject obj_to_enum(final ThreadContext context, IRubyObject s
20912093
};
20922094
}
20932095

2094-
boolean keywords = (callInfo & ThreadContext.CALL_KEYWORD) != 0 && (callInfo & ThreadContext.CALL_KEYWORD_EMPTY) == 0;
2095-
2096-
ThreadContext.resetCallInfo(context);
2096+
boolean keywords = hasNonemptyKeywords(ThreadContext.resetCallInfo(context));
20972097
return enumeratorizeWithSize(context, self, method, args, sizeFn, keywords);
20982098
}
20992099

0 commit comments

Comments
 (0)