tex-array is used to implement the (terrible, in my opinion) dwim subscripting and to typeset array arguments as subscripts. This produces invalid TeX:
tex(a_1[4]);
$$a_{1}_{4}$$
or
tex(a1[4]);
$$a_{1}_{4}$$
There are at least two alternatives:
tex-array in brace brackets. That would produce valid TeX like {{a_{1}}_{4}} in both cases.{\it a\_1}_{4} or {\it a1}_{4})Attached is a patch that implements both (but only does 1. when dwim subscripting is active).
This bug was first observed in bug #4696.
Patch.
For the record, I also think the DWIM inferred subscript stuff is terrible. That said, I think (1) is better than what we have now (and also preferable to (2)).