insertion with a int32 expression yields an unexpected error "variable size exceeded : less than 2147483647 expected."
Bug Description
insertion with a int32 expression yields an unexpected error "variable size exceeded : less than 2147483647 expected."
--> M(12*(n-1)+1:12*n) = 1;
variable size exceeded : less than 2147483647 expected.
When we pre-compute the expression, the error no longer occurs.
Steps to reproduce
n = int32(3);
clear M
M(12*(n-1)+1:12*n) = 1; // iterate this assignment by hand or in a for loop, with the same n => Error
j = 12*(n-1)+1:12*n;
M(j) = 1; // iterate => no longer any error
Remarks
This issue was detected while using stlread
from https://fileexchange.scilab.org/toolboxes/490000/2.1
- unzip the fileset
- run its builder
- run its loader
- go to its demo folder
- run ship_binary.sce several times: The first time is always OK. Sometime the second and third run as well. But the reported error finally occurs.
The message likely comes from https://gitlab.com/scilab/scilab/-/blob/minor/scilab/modules/ast/src/cpp/types/types_tools.cpp#L834
Edited by Samuel GOUGEON