Skip to content

Commit

Permalink
Showing 1 changed file with 7 additions and 5 deletions.
Original file line number Diff line number Diff line change
@@ -484,13 +484,15 @@ private RubyNode translateRubiniusInvokePrimitive(SourceSection sourceSection, C

final List<RubyNode> arguments = new ArrayList<>();

final Iterator<Node> childIterator = node.getArgsNode().childNodes().iterator();
// The first argument was the symbol so we ignore it
for (int n = 1; n < node.getArgsNode().childNodes().size(); n++) {
RubyNode readArgumentNode = node.getArgsNode().childNodes().get(n).accept(this);

// The first argument was the symbol, so skip it when gathering arguments to pass to the primitive
childIterator.next();
if (ArrayUtils.contains(primitive.getAnnotation().lowerFixnumParameters(), n)) {
readArgumentNode = new FixnumLowerNode(readArgumentNode);
}

while (childIterator.hasNext()) {
arguments.add(childIterator.next().accept(this));
arguments.add(readArgumentNode);
}

return new InvokeRubiniusPrimitiveNode(context, sourceSection,

0 comments on commit 1a706b9

Please sign in to comment.