patchGNU Octave - Patches: patch #8152, classdef: Fix crash when indexing...


patch #8152: classdef: Fix crash when indexing classdef object with empty parentheses.

Submitted by:  Philipp Kutin <pkutin>
Submitted on:  Mon 05 Aug 2013 11:19:35 AM UTC  
Category:  None Priority:  5 - Normal
Status:  Done Privacy:  Public
Assigned to:  None Open/Closed:  Closed

Add a New Comment(Rich Markup)

You are not logged in

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


Mon 27 Apr 2015 03:44:23 PM UTC, comment #5:

I filed a bug report about the Matlab incompatibility of not copying the object over when using empty indexing '()'. See

Rik <rik5>
Project Administrator
Sun 26 Apr 2015 04:21:52 PM UTC, comment #4:

I checked in Matlab and indeed, empty indexing should return the object and not throw an error:

Carnë Draug <carandraug>
Project Member
Sat 25 Apr 2015 05:26:49 PM UTC, comment #3:

No problem. I'm going to mark this as done and close it. If the segfaults return we can investigate further.

Rik <rik5>
Project Administrator
Sat 25 Apr 2015 04:54:47 PM UTC, comment #2:

I saw your changeset 20125:274b52724931 and to me it looks like what I intended back then: to prevent "something bad" happening (on reaching "Array<cdef_object> ires = array.index (iv, auto_add);"?) when the index vector is empty.

> Another consideration, shouldn't null indexing just return the object itself rather than generate an error?

Unfortunately I can't test this, since I don't have access to MATLAB anymore.

Philipp Kutin <pkutin>
Tue 21 Apr 2015 04:24:12 PM UTC, comment #1:

@Philipp: Could you re-generate your patch against a more recent version of the Mercurial source tree? I used hg import and the patch applied, but at a fuzzy offset of 450 lines. And when I went to test I still got a segfault so I don't think the patch applied cleanly.

Test object in foo.m

Test code

Another consideration, shouldn't null indexing just return the object itself rather than generate an error?

For matrices this is the case

Rik <rik5>
Project Administrator
Mon 05 Aug 2013 11:19:35 AM UTC, original submission:
  • check whether 'ival' is empty and generate an error in that case instead of continuing and crashing.


The crash is easy to reproduce: just create any classdef object, e.g. "o=TestClass()", then do "o()". Btw, the parent commit won't make sense -- it's my own (in classdef-pk), changing .hgignore for my setup (build subdir inside octave dir). But as far as I can see, "hg import" is pretty liberal...

Philipp Kutin <pkutin>


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

Attach Files:

Attached Files


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 pkutin (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 logged-in users can vote.


    Please enter the title of George Orwell's famous dystopian book (it's a date):



    Follow 3 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    Sat 25 Apr 2015 05:26:49 PM UTC rik5 StatusNone => Done
        Open/ClosedOpen => Closed
    Mon 05 Aug 2013 11:19:35 AM UTC pkutin Attached File- => Added classdef-fix-crash-empty-idxparen.patch, #28762

    Back to the top

    Powered by Savane 3.3