Mercurial > octave
changeset 33065:a2162efd8b80 bytecode-interpreter
Don't skip loop iterations if number of rows of loop array is zero (bug #55622).
pt-bytecode-vm.cc (vm::execute_code): Don't skip loop iterations if number of
rows of loop array is zero. Always loop over number of columns in the
re-dimensioned array.
author | Fernando Alvarruiz <feralber@upvnet.upv.es> |
---|---|
date | Sat, 17 Feb 2024 09:47:56 +0100 |
parents | 3bb4422bd982 |
children | ca78dc62d65f |
files | libinterp/parse-tree/pt-bytecode-vm.cc |
diffstat | 1 files changed, 3 insertions(+), 5 deletions(-) [+] |
line wrap: on
line diff
--- a/libinterp/parse-tree/pt-bytecode-vm.cc Tue Feb 20 15:07:51 2024 -0500 +++ b/libinterp/parse-tree/pt-bytecode-vm.cc Sat Feb 17 09:47:56 2024 +0100 @@ -3090,11 +3090,9 @@ // The iteration is column wise for these, so change // n to the amount of columns rather then elements. dim_vector dv = ov_range.dims ().redim (2); - int n_rows = dv (0); - if (n_rows) - n = dv(1); - else - n = 0; // A e.g. 0x3 sized Cell gives no iterations, not 3 + n = dv(1); + if (ov_range.ndims () > 2) + ov_range = ov_range.reshape (dv); } else if (ov_range.is_scalar_type () || ov_range.is_undefined ()) ;