# HG changeset patch # User Carnë Draug # Date 1382152525 -3600 # Node ID d6f4b01075e06a8f355e17b20c6b438869548523 # Parent 1efe4c65c5cffad730dcbba76ad945e758f9b479 convn: give error for non-string shape argument. * conv2.cc (convn): if value for the shape option was not a string, convn was silently using the default value. Fixed to give an error instead. diff --git a/libinterp/corefcn/conv2.cc b/libinterp/corefcn/conv2.cc --- a/libinterp/corefcn/conv2.cc +++ b/libinterp/corefcn/conv2.cc @@ -330,6 +330,11 @@ { if (args(2).is_string ()) shape = args(2).string_value (); + else + { + error ("convn: SHAPE must be a string"); + return retval; + } } if (shape == "full") @@ -397,4 +402,8 @@ /* FIXME: Need tests for convn in addition to conv2. +%!error convn () +%!error convn (1) +%!error convn (1,2, "NOT_A_SHAPE") +%!error convn (rand (3), 1, 1) */