[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Octave-bug-tracker] [bug #55758] classdef: delete method causes tempora

From: Mike Miller
Subject: [Octave-bug-tracker] [bug #55758] classdef: delete method causes temporaries to be deleted before use
Date: Thu, 21 Feb 2019 18:16:31 -0500 (EST)
User-agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/72.0.3626.109 Safari/537.36


                 Summary: classdef: delete method causes temporaries to be
deleted before use
                 Project: GNU Octave
            Submitted by: mtmiller
            Submitted on: Thu 21 Feb 2019 03:16:30 PM PST
                Category: Interpreter
                Severity: 3 - Normal
                Priority: 5 - Normal
              Item Group: Incorrect Result
                  Status: Confirmed
             Assigned to: None
         Originator Name: 
        Originator Email: 
             Open/Closed: Open
         Discussion Lock: Any
                 Release: dev
        Operating System: GNU/Linux



Attached is a classdef handle class example with a delete method. With this
example class, the following shows that temporary objects are deleted by the
interpreter before they are passed into the functions that they are arguments

>> class_delete_method (5).value
>> class_delete_method (5)(1)
>> disp (class_delete_method (5))
<object class_delete_method>
>> size (class_delete_method (5))
>> numel (class_delete_method (5))

The 'delete' destructor is called properly, it does have access to the class
properties when it is deleted, but the object is deleted by the interpreter
before it is placed on the call stack.

Removing the 'delete' method from the class definition restores the normal
behavior of how I would expect temporaries to work.

Because of the major rework of the call stack on the default branch recently,
I figured this would be a good candidate for fixing for Octave 6.

I also think the attached class is a good start for some BIST tests for the
delete method.

This was originally discussed in comments on bug #53844, so marking as


File Attachments:

Date: Thu 21 Feb 2019 03:16:30 PM PST  Name: class_delete_method.m  Size: 535B
  By: mtmiller



Reply to this item at:


  Message sent via Savannah

reply via email to

[Prev in Thread] Current Thread [Next in Thread]