# HG changeset patch # User Max Brister # Date 1346919549 21600 # Node ID de9bfcf637dfa40be608a7eb0952e80e7d261bb5 # Parent b055fc07722408004f00c9c328f5940648be60f7 Fix error when compiling with complex matrix (bug #37247) * jit-typeinfo.cc (jit_typeinfo::do_type_of): Correctly check for complex matricies. * pt-jit.cc (jit_convert::visit_constant): Correctly check for complex values. diff --git a/libinterp/interp-core/jit-typeinfo.cc b/libinterp/interp-core/jit-typeinfo.cc --- a/libinterp/interp-core/jit-typeinfo.cc +++ b/libinterp/interp-core/jit-typeinfo.cc @@ -2198,7 +2198,7 @@ if (ov.is_range ()) return get_range (); - if (ov.is_double_type ()) + if (ov.is_double_type () && ! ov.is_complex_type ()) { if (ov.is_real_scalar ()) return get_scalar (); diff --git a/libinterp/interp-core/pt-jit.cc b/libinterp/interp-core/pt-jit.cc --- a/libinterp/interp-core/pt-jit.cc +++ b/libinterp/interp-core/pt-jit.cc @@ -489,7 +489,7 @@ jit_convert::visit_constant (tree_constant& tc) { octave_value v = tc.rvalue1 (); - if (v.is_real_scalar () && v.is_double_type ()) + if (v.is_real_scalar () && v.is_double_type () && ! v.is_complex_type ()) { double dv = v.double_value (); result = factory.create (dv); @@ -2099,4 +2099,13 @@ %! assert (a, 2000); %! assert (b, 1); +%!test +%! a = [1+1i 1+2i]; +%! b = 0; +%! while 1 +%! b = a(1); +%! break; +%! endwhile +%! assert (b, a(1)); + */