Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Fixed
-
None
-
None
-
None
Description
Matrix and frame right indexing is subject to rewrites, where we simplify for example X[,a] to {X}} if the input and output have equal sizes. This rewrite is, however, only valid if the index ranges are valid. We do throw validation errors during parsing, but this does not apply to matrices and index expressions that are unknown during initial compilation.
For, example the below expressions computes 1000 although it should throw an error:
X = matrix(1, 1000, 1);
if( 0!=0 )
X = cbind(X,X);
print(sum(X[,2]))