# HG changeset patch # User jwe # Date 763173204 0 # Node ID 3dc943e34d9ace12da583f730a911fac8a72e3ce # Parent 568caeb70630ca075d546a8e757f061b7364a6d7 [project @ 1994-03-09 00:33:24 by jwe] diff --git a/src/tc-index.cc b/src/tc-index.cc --- a/src/tc-index.cc +++ b/src/tc-index.cc @@ -1,7 +1,7 @@ // tc-index.cc -*- C++ -*- /* -Copyright (C) 1992, 1993 John W. Eaton +Copyright (C) 1992, 1993, 1994 John W. Eaton This file is part of Octave. @@ -360,6 +360,12 @@ int len = nr > nc ? nr : nc; + if (nr == 0 || nc == 0) + { + ::error ("attempt to index empty matrix"); + return retval; + } + assert ((nr == 1 || nc == 1) && ! user_pref.do_fortran_indexing); int swap_indices = (nr == 1);