# HG changeset patch # User jwe # Date 1110815624 0 # Node ID 240ed0328925b3109ec020f0a2ef2cd5184f48e0 # Parent 16a6247730d9a0904ff7ea3c94732e73878169f3 [project @ 2005-03-14 15:53:44 by jwe] diff -r 16a6247730d9 -r 240ed0328925 src/ChangeLog --- a/src/ChangeLog Thu Mar 10 20:24:45 2005 +0000 +++ b/src/ChangeLog Mon Mar 14 15:53:44 2005 +0000 @@ -1,3 +1,8 @@ +2005-03-14 John W. Eaton + + * DLD-FUNCTIONS/dispatch.cc (Fbuiltin): Avoid crash if symbol + lookup fails. + 2005-03-10 John W. Eaton * toplev.cc (Foctave_config_info): Print error instead of crashing diff -r 16a6247730d9 -r 240ed0328925 src/DLD-FUNCTIONS/dispatch.cc --- a/src/DLD-FUNCTIONS/dispatch.cc Thu Mar 10 20:24:45 2005 +0000 +++ b/src/DLD-FUNCTIONS/dispatch.cc Mon Mar 14 15:53:44 2005 +0000 @@ -307,16 +307,22 @@ return retval; symbol_record *sr = fbi_sym_tab->lookup (name, 0); - if (sr->def().type_id () == octave_dispatch::static_type_id ()) + + if (sr) { - octave_function *fcn = builtin (name); + if (sr->def().type_id () == octave_dispatch::static_type_id ()) + { + octave_function *fcn = builtin (name); - if (!error_state && fcn) - retval = fcn->do_multi_index_op (nargout, - args.splice (0, 1, retval)); + if (!error_state && fcn) + retval = fcn->do_multi_index_op (nargout, + args.splice (0, 1, retval)); + } + else + retval = feval (name, args, nargout); } else - retval = feval (name, args, nargout); + error ("builtin: lookup for symbol `%s' failed", name.c_str ()); } else print_usage ("builtin");