diff src/pt-mat.cc @ 13754:e652ff4d1522

don't crash when concatenating structs with no fields * oct-map.cc (octave_map::cat (int, octave_idx_type, const octave_scalar_map*)): Quick return for N == 1. (octave_map::cat (int, octave_idx_type, const octave_map*)): Quick return for N == 1. Only call permute_to_correct_order if there are fields. Use dim_vector::concat to compute result dimensions if there are no fields. New tests for concatentation of structs with no fields. * pt-mat.cc (tm_const::init (const tree_matrix&)): Initialize all_1x1 to true if tree_matrix argument is not empty.
author John W. Eaton <jwe@octave.org>
date Wed, 26 Oct 2011 00:50:39 -0400
parents 7dce7e110511
children 0a158dbdb04a
line wrap: on
line diff
--- a/src/pt-mat.cc	Tue Oct 25 21:23:37 2011 -0700
+++ b/src/pt-mat.cc	Wed Oct 26 00:50:39 2011 -0400
@@ -546,7 +546,7 @@
   any_cell = false;
   any_sparse = false;
   any_class = false;
-  all_1x1 = ! empty ();
+  all_1x1 = ! tm.empty ();
 
   bool first_elem = true;
   bool first_elem_is_struct = false;