Skip to content

Commit

Permalink
Fixes #4154. Wrong line number reported in backtrace in hash creation.
Browse files Browse the repository at this point in the history
I took a somewhat minimal approach to fixing this in that all calls can
potentially raise in execution so I potentially add linenum instrs when
building any type of call node.  In theory anything with a side-effect
could cause this like a special global etc...  This will hit high 90%
of the issue at least.  I am also wondering if this will regress anything
so it is a good tester before I make the AST know about whether a subtree
contains a potential side-effecting node (which is the longer term fix).
enebo committed Mar 12, 2017
1 parent 4520eb1 commit 6c8ec1a
Showing 3 changed files with 3 additions and 0 deletions.
1 change: 1 addition & 0 deletions core/src/main/java/org/jruby/ast/CallNode.java
Original file line number Diff line number Diff line change
@@ -66,6 +66,7 @@ public CallNode(ISourcePosition position, Node receiverNode, String name, Node a
this.argsNode = argsNode;
this.iterNode = iterNode;
this.isLazy = isLazy;
setNewline();
}

public NodeType getNodeType() {
1 change: 1 addition & 0 deletions core/src/main/java/org/jruby/ast/FCallNode.java
Original file line number Diff line number Diff line change
@@ -53,6 +53,7 @@ public FCallNode(ISourcePosition position, String name, Node argsNode, Node iter
this.name = name;
this.argsNode = argsNode;
this.iterNode = iterNode;
setNewline();
}

public NodeType getNodeType() {
1 change: 1 addition & 0 deletions core/src/main/java/org/jruby/ast/VCallNode.java
Original file line number Diff line number Diff line change
@@ -48,6 +48,7 @@ public VCallNode(ISourcePosition position, String name) {
super(position, false);

this.name = name;
setNewline();
}

public NodeType getNodeType() {

0 comments on commit 6c8ec1a

Please sign in to comment.