# HG changeset patch # User Michael Goffioul # Date 1358301184 18000 # Node ID 4aedc32e3f4d3d0d921e11d1432c62030a4aaf95 # Parent db6371b97fed5c44badbca3b146e0d38b54a3801 Check constructor access. * libinterp/octave-value/ov-classdef.cc (cdef_class::cdef_class_rep::run_constructor): Check constructor method access. diff -r db6371b97fed -r 4aedc32e3f4d libinterp/octave-value/ov-classdef.cc --- a/libinterp/octave-value/ov-classdef.cc Tue Jan 15 19:52:18 2013 -0500 +++ b/libinterp/octave-value/ov-classdef.cc Tue Jan 15 20:53:04 2013 -0500 @@ -2099,23 +2099,28 @@ if (ctor.ok ()) { - octave_value_list ctor_args (args); - octave_value_list ctor_retval; - - ctor_args.prepend (to_ov (obj)); - ctor_retval = ctor.execute (ctor_args, 1); - - if (! error_state) + if (ctor.check_access ()) { - if (ctor_retval.length () == 1) - obj = to_cdef (ctor_retval(0)); - else + octave_value_list ctor_args (args); + octave_value_list ctor_retval; + + ctor_args.prepend (to_ov (obj)); + ctor_retval = ctor.execute (ctor_args, 1); + + if (! error_state) { - ::error ("%s: invalid number of output arguments for classdef constructor", - ctor_name.c_str ()); - return; + if (ctor_retval.length () == 1) + obj = to_cdef (ctor_retval(0)); + else + { + ::error ("%s: invalid number of output arguments for classdef constructor", + ctor_name.c_str ()); + return; + } } } + else + gripe_method_access ("constructor", ctor); } obj.mark_as_constructed (wrap ());