changeset 28543:1c0a4e1b973e

maint: merge stable to default.
author John W. Eaton <jwe@octave.org>
date Wed, 08 Jul 2020 08:15:27 -0400
parents 5f4e8dddf05f (current diff) c318254c9f01 (diff)
children 605b9e811bf3
files
diffstat 1 files changed, 24 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/libinterp/parse-tree/pt-tm-const.cc	Tue Jul 07 19:40:20 2020 -0400
+++ b/libinterp/parse-tree/pt-tm-const.cc	Wed Jul 08 08:15:27 2020 -0400
@@ -171,7 +171,7 @@
         octave_value tmp = elt->evaluate (tw);
 
         if (tmp.is_undefined ())
-          return;
+          continue;
 
         if (tmp.is_cs_list ())
           {
@@ -318,7 +318,7 @@
           }
 
         if (row.empty ())
-          break;
+          continue;
 
         if (m_all_strings && ! row.all_strings_p ())
           m_all_strings = false;
@@ -927,4 +927,26 @@
 %!assert (isnull ([;;]))
 %!assert (isnull ([;,;]))
 %!assert (isnull ([,;,;,]))
+
+## Undefined elements.
+%!function my_undef ()
+%!endfunction
+%!
+%!shared es
+%! es = struct ("a", {});
+%!
+%!assert <58695> ([1, es.a, 3], [1, 3])
+%!assert <58695> ([1, my_undef(), 3], [1, 3])
+%!
+%!assert <58695> ([es.a, es.a, 3], 3)
+%!assert <58695> ([my_undef(), my_undef(), 3], 3)
+%!
+%!assert <58695> ([1; es.a; 3], [1; 3])
+%!assert <58695> ([1; my_undef(), 3], [1; 3])
+%!
+%!assert <58695> ([es.a; es.a; 3], 3)
+%!assert <58695> ([my_undef(); my_undef(); 3], 3)
+%!
+%!assert <58695> ([es.a; es.a; 3], 3)
+%!assert <58695> ([my_undef(); my_undef(); 3], 3)
 */