# HG changeset patch # User Max Brister # Date 1346033179 21600 # Node ID a38d5ed5b3d894aa1812250b926f1490afd790cb # Parent c4779a18013441ef37b7c196fa747d1ae7aa8045 dot.cc: Segfault with integers (bug #37199) diff --git a/libinterp/corefcn/dot.cc b/libinterp/corefcn/dot.cc --- a/libinterp/corefcn/dot.cc +++ b/libinterp/corefcn/dot.cc @@ -215,7 +215,7 @@ { // Non-optimized evaluation. octave_value_list tmp; - tmp(1) = args(2); + tmp(1) = dim + 1; tmp(0) = do_binary_op (octave_value::op_el_mul, argx, argy); if (! error_state) { @@ -247,6 +247,19 @@ %!test %! x = [1+i, 3-i; 1-i, 3-i]; %! assert (dot (x, x), [4, 20]); + +%!test +%! x = int8 ([1 2]); +%! y = int8 ([2 3]); +%! assert (dot (x, y), 8); + +%!test +%! x = int8 ([1 2; 3 4]); +%! y = int8 ([5 6; 7 8]); +%! assert (dot (x, y), [26 44]); +%! assert (dot (x, y, 2), [17; 53]); +%! assert (dot (x, y, 3), [5 12; 21 32]); + */ DEFUN (blkmm, args, ,