Skip to content

Commit

Permalink
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion core/src/main/java/org/jruby/ir/IRBuilder.java
Original file line number Diff line number Diff line change
@@ -386,14 +386,18 @@ private void emitEnsureBlocks(IRLoop loop) {
}
}

private Operand buildOperand(Variable result, Node node) throws NotCompilableException {
private void determineIfWeNeedLineNumber(Node node) {
if (node.isNewline()) {
int currLineNum = node.getLine();
if (currLineNum != _lastProcessedLineNum) { // Do not emit multiple line number instrs for the same line
needsLineNumInfo = true;
_lastProcessedLineNum = currLineNum;
}
}
}

private Operand buildOperand(Variable result, Node node) throws NotCompilableException {
determineIfWeNeedLineNumber(node);

switch (node.getNodeType()) {
case ALIASNODE: return buildAlias((AliasNode) node);
@@ -2700,6 +2704,7 @@ public Operand buildFCall(Variable result, FCallNode fcallNode) {
}
}

determineIfWeNeedLineNumber(fcallNode); // buildOperand for fcall was papered over by args operand building so we check once more.
CallInstr callInstr = CallInstr.create(scope, CallType.FUNCTIONAL, result, fcallNode.getName(), buildSelf(), args, block);
receiveBreakException(block, callInstr);
return result;

0 comments on commit d7d063d

Please sign in to comment.