Closed pbaam closed 1 year ago
This script will segfault:
#!/usr/bin/env lua ltreesitter = require"ltreesitter" json = ltreesitter.require"json" tree = json:parse_string('{"a": 1, "b": 2, "c": 3}') print(tree:root():child(0):named_child(3))
The number of named children is 3, but the number of children is 7. So using indexes between 3 and 7 will result in a segmentation fault. Using indexes above 7 will print nil as expected The grammar used is https://github.com/tree-sitter/tree-sitter-json/tree/73076754005a460947cafe8e03a8cf5fa4fa2938
Thanks!
This script will segfault:
The number of named children is 3, but the number of children is 7. So using indexes between 3 and 7 will result in a segmentation fault. Using indexes above 7 will print nil as expected The grammar used is https://github.com/tree-sitter/tree-sitter-json/tree/73076754005a460947cafe8e03a8cf5fa4fa2938