bugGNU Octave - Bugs: bug #59126, max_recursion_depth exceeded when...

 
 

bug #59126: max_recursion_depth exceeded when calling builtin 'end' from redefined 'end'

Submitter:  Fernando <tutissanalio>
Submitted:  Fri 18 Sep 2020 12:08:13 AM UTC
   
 
Category:  Interpreter Severity:  3 - Normal
Priority:  5 - Normal Item Group:  Unexpected Error or Warning
Status:  Fixed Assigned to:  None
Originator Name:  Open/Closed:  * Closed
Release:  * 6.0.90 Operating System:  * Any
Fixed Release:  None Planned Release:  None
* Mandatory Fields

Add a New Comment Rich Markup
   

Wed 30 Sep 2020 11:44:47 PM UTC, comment #1: 

Apparently this has been fixed on the stable branch.  I tested the motivating example in the original submission with changeset 28846:2219027f5bd4 and it produces the Matlab result.

Rik <rik5>
Group administrator
Fri 18 Sep 2020 12:08:13 AM UTC, original submission:  

I defined the following class, which redefines the END method to print a message:


classdef classend < handle
  properties
    data
  end
  methods
    function obj = classend(data)
      obj.data = data;
    end
    function r = end(obj,k,n)
      fprintf('''end'' called with index=%d of %d\n',k,n);
      r = builtin('end',obj,k,n);
    end
  end
end


then I get the following error when using END:


octave:1> obj=classend(1:5)
obj =
  classend object with properties:
      data: [1x5 double]
octave:2> obj(end)
'end' called with index=1 of 1
'end' called with index=1 of 1
'end' called with index=1 of 1
... (deleted lines) ...
'end' called with index=1 of 1
'end' called with index=1 of 1
error: max_recursion_depth exceeded
error: called from
    end
    end at line 11 column 9


Instead of that, the result should have been (like in Matlab):


octave:2> obj(end)
'end' called with index=1 of 1
ans =
  classend object with properties:
      data: [1x5 double]


Fernando <tutissanalio>

 

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

Attach Files:
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

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

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

    Only group members can vote.

     

    Follow 2 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2020-09-30 rik5 StatusNone Fixed
        Open/ClosedOpen Closed

    Back to the top

    Powered by Savane 3.13-4448.
    Corresponding source code