On assigning variables the source variable becomes corrupted (e.g. x=[3 4 5];y(1,:)=x;)
Reported by Roland Saur-Brosch
BUG DESCRIPTION:
----------------
Assigning the content of a (source) row vector variable to a new (destination) variable, specifying one row or column of the new variable and leaving the other dimension "open" to allow different vector sizes, transposes the source vector, making it a virtual square matrix (acknowledged as such by size()) while it is still recognized as a row vector but with the remaining columns at random values (sometimes values of other variables).
ERROR LOG:
----------
Entered in console in mode(2):
--> u
Undefined variable: u
--> v
Undefined variable: v
--> u=[3 4 5]
u =
3. 4. 5.
--> u
u =
3. 4. 5.
--> v(1,:)=u
v =
3. 4. 5.
--> u
u =
3. 0. 0.
--> size(u)
ans =
3. 3.
--> u(1)
ans =
3.
--> u(2)
ans =
4.
--> u(3)
ans =
5.
--> size(u)
ans =
3. 3.
--> u
u =
3. 0. 0.
--> u(:,:)
ans =
3. 0. 0.
4. 0. 0.
5. 0. 9.1512552900300256908395
The 9.1512552900300256908395 was a result from a previously done calculation, so it seems u still has only 3 entries but if Scilab tries to extract the "ghost" entries it accesses adjacent memory locations.
HOW TO REPRODUCE THE BUG:
-------------------------
Just repeat the error log.
OTHER INFORMATION:
------------------