Skip to content

Commit

Permalink
ast/compile: don't lookup Call TreeNode children (#5255)
Browse files Browse the repository at this point in the history
This fixes this crasher, identified by the nightly fuzz run:

    package A
    A0 {
      A(0).A(0)
    }

Signed-off-by: Stephan Renatus <stephan.renatus@gmail.com>
  • Loading branch information
srenatus authored Oct 16, 2022
1 parent ca713cf commit fd7d982
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion ast/compile.go
Original file line number Diff line number Diff line change
Expand Up @@ -3106,7 +3106,7 @@ func (n *TreeNode) Size() int {
// Child returns n's child with key k.
func (n *TreeNode) Child(k Value) *TreeNode {
switch k.(type) {
case Ref:
case Ref, Call:
return nil
default:
return n.Children[k]
Expand Down

0 comments on commit fd7d982

Please sign in to comment.