bugGNU Octave - Bugs: bug #59775, "error: mark_as_constructed:...


bug #59775: "error: mark_as_constructed: invalid object" when constructor returns classdef array

Submitted by:  None
Submitted on:  Tue 29 Dec 2020 11:42:25 AM UTC  
Category:  Interpreter Severity:  3 - Normal
Priority:  5 - Normal Item Group:  Unexpected Error or Warning
Status:  Confirmed Assigned to:  None
Originator Name:  Marc Pfetsch Originator Email:  -email is unavailable-
Open/Closed:  Open Release:  dev
Operating System:  Any

Add a New Comment (Rich Markup)

You are not logged in

Please log in, so followups can be emailed to you.


Sun 17 Jan 2021 05:29:27 PM UTC, comment #1: 

I can confirm this error in Octave 5.2, 6.1, a current stable (hg id 8b65dc1fd34d), and default (hg id 1ece396fe3df).

The same class constructs without error with Matlab R2020b.

Markus M├╝tzel <mmuetzel>
Project Member
Tue 29 Dec 2020 11:42:25 AM UTC, original submission:  

The attached class produces the error

error: mark_as_constructed: invalid object

e.g. for the call M=MAC(2).

To fix the problem one can do the following, although I am not sure whether the solution is correct:

In libinterp/octave-value/cdef-object.h and in

  class cdef_object_array : public cdef_object_base

one can add

  void mark_as_constructed (void) { }
  void mark_as_constructed (const cdef_class& cls) { }

In any case, the original virtual functions do not seem to be overloaded correctly for "arrays of classes".



(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach Files:

Attached Files
file #50584:  MAC.m added by None (321B - text/x-objcsrc - Mark As Constructed error example)


Depends on the following items: None found

Items that depend on this one: None found


Carbon-Copy List
  • -email is unavailable- added by mmuetzel (Posted a comment)
  • -email is unavailable- added by None (Submitted the item)

    Do you think this task is very important?
    If so, you can add your encouragement to it.
    This task has 0 encouragements so far.

    Only project members can vote.




    Follow 6 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2021-01-17 mmuetzel CategoryOctave Function => Interpreter
        StatusNone => Confirmed
        Release6.1.0 => dev
        Operating SystemGNU/Linux => Any
        Summaryerror: mark_as_constructed: invalid object => "error: mark_as_constructed: invalid object" when constructor returns classdef array
    2020-12-29 None Attached File- => Added MAC.m, #50584

    Back to the top

    Powered by Savane 3.6