Mercurial > hg > octave-lyh
changeset 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 | 8fa0b416f465 |
children | c1d5bf2eb3b6 |
files | libinterp/parse-tree/pt-idx.cc scripts/miscellaneous/orderfields.m |
diffstat | 2 files changed, 7 insertions(+), 2 deletions(-) [+] |
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 ();