diff libinterp/octave-value/ov.cc @ 25927:d6581134daaa

Emit an error when utility matrices (zeros, ones, rand, etc.) are given a fractional dimension in a dimension vector (bug #54781). * data.cc (Fones): Add BIST test with a fractional dimension in a dimension vector. * rand.cc (do_rand): Convert dimension vector to Array<octave_idx_type>, not an Array<int>. Call "octave_idx_type_vector_value (true)" to enable input validation. * rand.cc (Frand): Add BIST test with a fractional dimension in a dimension vector. * utils.cc (get_dimensions): Call "octave_idx_type_vector_value (true)" to enable input validation. * ov.cc (int_vector_value, octave_idx_type_vector_value): Change error message when conversion fails to print the original value that failed.
author Rik <rik@octave.org>
date Thu, 11 Oct 2018 15:48:51 -0700
parents 6652d3823428
children 0549d088f50e
line wrap: on
line diff
--- a/libinterp/octave-value/ov.cc	Thu Oct 11 14:04:47 2018 -0700
+++ b/libinterp/octave-value/ov.cc	Thu Oct 11 15:48:51 2018 -0700
@@ -1805,7 +1805,7 @@
                 retval.xelem (i) = v;
               else
                 {
-                  error_with_cfn ("conversion to integer value failed");
+                  error_with_cfn ("conversion of %g to int value failed", ai);
                   break;
                 }
             }
@@ -1875,7 +1875,7 @@
                 retval.xelem (i) = v;
               else
                 {
-                  error_with_cfn ("conversion to integer value failed");
+                  error_with_cfn ("conversion of %g to octave_idx_type value failed", ai);
                   break;
                 }
             }