summaryrefslogtreecommitdiff
path: root/test/ruby
diff options
context:
space:
mode:
authorMike Dalessio <mike.dalessio@gmail.com>2023-08-30 09:59:09 -0400
committergit <svn-admin@ruby-lang.org>2023-08-30 20:46:08 +0000
commitf80582cda8fb0d994db0c1cdf1c282f3a049485c (patch)
tree7a445134b7408a21e57b1f09a425b0ad1d07cb2e /test/ruby
parent209eda599a06682b0d32aa84870038e854fc49ef (diff)
[ruby/yarp] fix: StatementsNode with out-of-order body nodes
The presence of the heredocs in this snippet with invalid syntax: for <<A + <<B A B causes the MissingNode to have a location after other nodes in the list, resulting in a StatementsNode with inverted start and end locations: [ForNode(0...14)( MultiWriteNode(4...7)([InterpolatedStringNode(4...7)((4...7), [], (14...16))], nil, nil, nil, nil), MissingNode(16...16)(), > StatementsNode(16...14)( [MissingNode(16...16)(), InterpolatedStringNode(10...13)((10...13), [], (16...18)), MissingNode(13...14)()] ), (0...3), (16...16), nil, (14...14) )] which failed an assertion during serialization. With this fix, the node's locations are: [ForNode(0...14)( MultiWriteNode(4...7)([InterpolatedStringNode(4...7)((4...7), [], (14...16))], nil, nil, nil, nil), MissingNode(16...16)(), > StatementsNode(10...16)( [MissingNode(16...16)(), InterpolatedStringNode(10...13)((10...13), [], (16...18)), MissingNode(13...14)()] ), (0...3), (16...16), nil, (14...14) )] Found by the fuzzer. https://github.com/ruby/yarp/commit/09bcedc05e
Diffstat (limited to 'test/ruby')
0 files changed, 0 insertions, 0 deletions