Skip to content

Commit b120df4

Browse files
Use stack.Clone() to copy stack
1 parent b528d8b commit b120df4

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

pkg/processing/find_field.go

+1-3
Original file line numberDiff line numberDiff line change
@@ -48,9 +48,7 @@ func FindRangesFromIndexList(stack *nodestack.NodeStack, indexList []string, vm
4848
}
4949
foundDesugaredObjects = append(foundDesugaredObjects, lhsObject)
5050
} else if start == "self" {
51-
tmpStack := nodestack.NewNodeStack(stack.From)
52-
tmpStack.Stack = make([]ast.Node, len(stack.Stack))
53-
copy(tmpStack.Stack, stack.Stack)
51+
tmpStack := stack.Clone()
5452

5553
// Special case. If the index was part of a binary node (ex: self.foo + {...}),
5654
// then the second element's content should not be considered to find the index's reference

0 commit comments

Comments
 (0)