Commit 6b5bc14
committed
[treeplayer] Fix TTreeFormula vector index into vector-of-vectors
When a vector-type branch was used as the index of a vector-of-vectors
branch, TTreeFormula computed the wrong number of instances and emitted
out-of-bounds errors. For example, with v2 a vector<int> used as an index:
vv1[v2][0] looped over the summed size of all sub-vectors of vv1
instead of the length of v2, printing a spurious extra
instance and "index out of bound" errors.
vv1[0][v2] silently dropped its last instance.
Two issues in the multi-variable-dimension machinery:
1. DefineDimensions registered the inner jagged dimension as a variable
dimension even when the outer dimension is selected through a variable
"gather" index (-2) and the inner dimension is pinned to a constant.
In that configuration the formula does not iterate over the jagged
sub-dimension, so the manager must not sum the physical sub-sizes; the
number of instances is simply the length of the index variable.
2. GetRealInstance performed a premature out-of-bounds check against the
physical sub-size for a variable inner index (-2), using the raw
instance number (the index of the index variable) rather than the
evaluated index. The real bounds are already checked after evaluating
the index variable.
Adds regression tests to treeplayer_regressions.
Closes #19290 (originally JIRA ROOT-8726).
🤖 Done with the help of [Claude Code](https://claude.com/claude-code) (Claude Opus 4.8)1 parent a622764 commit 6b5bc14
2 files changed
Lines changed: 109 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
375 | 375 | | |
376 | 376 | | |
377 | 377 | | |
378 | | - | |
| 378 | + | |
| 379 | + | |
| 380 | + | |
| 381 | + | |
| 382 | + | |
| 383 | + | |
| 384 | + | |
| 385 | + | |
| 386 | + | |
| 387 | + | |
| 388 | + | |
| 389 | + | |
| 390 | + | |
379 | 391 | | |
380 | 392 | | |
381 | | - | |
| 393 | + | |
382 | 394 | | |
383 | 395 | | |
384 | 396 | | |
| |||
3631 | 3643 | | |
3632 | 3644 | | |
3633 | 3645 | | |
3634 | | - | |
| 3646 | + | |
3635 | 3647 | | |
| 3648 | + | |
| 3649 | + | |
| 3650 | + | |
3636 | 3651 | | |
3637 | 3652 | | |
3638 | 3653 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
661 | 661 | | |
662 | 662 | | |
663 | 663 | | |
| 664 | + | |
| 665 | + | |
| 666 | + | |
| 667 | + | |
| 668 | + | |
| 669 | + | |
| 670 | + | |
| 671 | + | |
| 672 | + | |
| 673 | + | |
| 674 | + | |
| 675 | + | |
| 676 | + | |
| 677 | + | |
| 678 | + | |
| 679 | + | |
| 680 | + | |
| 681 | + | |
| 682 | + | |
| 683 | + | |
| 684 | + | |
| 685 | + | |
| 686 | + | |
| 687 | + | |
| 688 | + | |
| 689 | + | |
| 690 | + | |
| 691 | + | |
| 692 | + | |
| 693 | + | |
| 694 | + | |
| 695 | + | |
| 696 | + | |
| 697 | + | |
| 698 | + | |
| 699 | + | |
| 700 | + | |
| 701 | + | |
| 702 | + | |
| 703 | + | |
| 704 | + | |
| 705 | + | |
| 706 | + | |
| 707 | + | |
| 708 | + | |
| 709 | + | |
| 710 | + | |
| 711 | + | |
| 712 | + | |
| 713 | + | |
| 714 | + | |
| 715 | + | |
| 716 | + | |
| 717 | + | |
| 718 | + | |
| 719 | + | |
| 720 | + | |
| 721 | + | |
| 722 | + | |
| 723 | + | |
| 724 | + | |
| 725 | + | |
| 726 | + | |
| 727 | + | |
| 728 | + | |
| 729 | + | |
| 730 | + | |
| 731 | + | |
| 732 | + | |
| 733 | + | |
| 734 | + | |
| 735 | + | |
| 736 | + | |
| 737 | + | |
| 738 | + | |
| 739 | + | |
| 740 | + | |
| 741 | + | |
| 742 | + | |
| 743 | + | |
| 744 | + | |
| 745 | + | |
| 746 | + | |
| 747 | + | |
| 748 | + | |
| 749 | + | |
| 750 | + | |
| 751 | + | |
| 752 | + | |
| 753 | + | |
| 754 | + | |
0 commit comments