Mercurial > hg > octave-lyh
changeset 6149:3a68a2dc6eb1
[project @ 2006-11-09 18:26:56 by jwe]
author | jwe |
---|---|
date | Thu, 09 Nov 2006 18:26:56 +0000 |
parents | 4010c7474c9b |
children | 2ad8962722cc |
files | ChangeLog configure.in src/ChangeLog src/load-path.cc src/ov-usr-fcn.cc src/ov-usr-fcn.h src/pt-fcn-handle.cc |
diffstat | 7 files changed, 41 insertions(+), 8 deletions(-) [+] |
line wrap: on
line diff
--- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2006-11-09 Michael Goffioul <michael.goffioul@swing.be> + + * configure.in (OCTAVE_LOCAL_BUFFER): Don't access first element + if size is 0. + 2006-11-06 Michael Goffioul <michael.goffioul@swing.be> * configure.in (CRUFT_DLL_DEFS, OCTAVE_DLL_DEFS, OCTINTERP_DLL_DEFS):
--- a/configure.in +++ b/configure.in @@ -29,7 +29,7 @@ EXTERN_CXXFLAGS="$CXXFLAGS" AC_INIT -AC_REVISION($Revision: 1.544 $) +AC_REVISION($Revision: 1.545 $) AC_PREREQ(2.57) AC_CONFIG_SRCDIR([src/octave.cc]) AC_CONFIG_HEADER(config.h) @@ -1920,7 +1920,7 @@ #define OCTAVE_LOCAL_BUFFER(T, buf, size) \ std::vector< T > buf ## _vector (size); \ - T *buf = &(buf ## _vector[0]) + T *buf = ((size) > 0 ? &(buf ## _vector[0]) : 0) /* #endif */
--- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,22 @@ +2006-11-09 John W. Eaton <jwe@octave.org> + + * ov-usr-fcn.h (octave_user_function::inline_function): + New data member. + (octave_user_function::mark_as_inline_function): Set it. + (octave_user_function::is_inline_function): Check it. + * ov-usr-fcn.cc (octave_user_function::do_multi_index_op): + Also skip setting curr_parent_fucntion if evaluating an inline + function. + (octave_user_function::octave_user_function): + Initialize inline_function. + * pt-fcn-handle.cc (tree_anon_fcn_handle::rvalue): + Mark user function as inline here. + +2006-11-09 Michael Goffioul <michael.goffioul@swing.be> + + * load-path.cc (load_path::move): Don't use reference to file_info + object that will be erased. + 2006-11-07 John W. Eaton <jwe@octave.org> * utils.cc (file_in_path): Don't unconditionally return "".
--- a/src/load-path.cc +++ b/src/load-path.cc @@ -325,7 +325,7 @@ { if (p->dir_name == dir) { - file_info& fi = *p; + file_info fi = *p; file_info_list.erase (p);
--- a/src/ov-usr-fcn.cc +++ b/src/ov-usr-fcn.cc @@ -76,10 +76,10 @@ sym_tab (st), lead_comm (), trail_comm (), file_name (), t_parsed (static_cast<time_t> (0)), t_checked (static_cast<time_t> (0)), - system_fcn_file (false), call_depth (0), - num_named_args (0), nested_function (false), - args_passed (), num_args_passed (0), symtab_entry (0), - argn_sr (0), nargin_sr (0), nargout_sr (0), varargin_sr (0) + system_fcn_file (false), call_depth (0), num_named_args (0), + nested_function (false), inline_function (false), args_passed (), + num_args_passed (0), symtab_entry (0), argn_sr (0), + nargin_sr (0), nargout_sr (0), varargin_sr (0) { if (param_list) num_named_args = param_list->length (); @@ -303,7 +303,7 @@ unwind_protect::add (octave_call_stack::unwind_pop, 0); - if (! is_nested_function ()) + if (! (is_nested_function () || is_inline_function ())) { unwind_protect_ptr (curr_parent_function); curr_parent_function = this;
--- a/src/ov-usr-fcn.h +++ b/src/ov-usr-fcn.h @@ -146,6 +146,10 @@ bool is_nested_function (void) const { return nested_function; } + void mark_as_inline_function (void) { inline_function = true; } + + bool is_inline_function (void) const { return inline_function; } + void save_args_passed (const octave_value_list& args) { if (call_depth > 1) @@ -240,6 +244,9 @@ // TRUE means this is a nested function. bool nested_function; + // TRUE means this is an inline function. + bool inline_function; + // The values that were passed as arguments. octave_value_list args_passed;