diff libinterp/parse-tree/pt-idx.cc @ 16656:cf84ea2ba2d3

require dynamic field names to be character strings * pt-idx.cc (tree_index_expression::get_struct_index): Require field names to be character strings. * orderfields.m: Index fieldnames with {} instead of ().
author John W. Eaton <jwe@octave.org>
date Mon, 13 May 2013 18:50:14 -0400
parents 302157614308
children 8291109ac3fd
line wrap: on
line diff
--- a/libinterp/parse-tree/pt-idx.cc
+++ b/libinterp/parse-tree/pt-idx.cc
@@ -216,7 +216,12 @@
           octave_value t = df->rvalue1 ();
 
           if (! error_state)
-            fn = t.string_value ();
+            {
+              if (t.is_string ())
+                fn = t.string_value ();
+              else
+                error ("dynamic structure field names must be character strings");
+            }
         }
       else
         panic_impossible ();