On Tue Nov 28 18:31:46 2023 +0000, Dmitry Sokolov wrote:
Checking of the upper boundary is not enough. Var offset should correspond to the given var index.
right ; I meant (as varoffset is always >= 0) `varidx + varoffset < get_varidx_upper_boundary(varidx)`
by point is that I think that these loops could be better rewritten to show the underlying logic and moving that logic in a helper function called for each iteration makes it harder to read
note that varidx is constant in the function, so the upper bound could be computed once for all and used in all loops
(I wished that the error case varidx < 0 should had been dropped early instead of polluting all parts of the function)