[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Octave-bug-tracker] [bug #60791] classdef subsasgn / subsref called inc
From: |
Fernando |
Subject: |
[Octave-bug-tracker] [bug #60791] classdef subsasgn / subsref called incorrectly |
Date: |
Sun, 26 Dec 2021 05:31:01 -0500 (EST) |
User-agent: |
Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:95.0) Gecko/20100101 Firefox/95.0 |
Follow-up Comment #2, bug #60791 (project octave):
I had a look at the issue and I found the cause. In the sequence of
instructions:
T1 = rdz_table(1);
cls = @rdz_table;
T2 = rdz_table(2);
when executing
cls = @rdz_table;
the definition of the class constructor is not found, although it should, and
the class is loaded again. This causes problems later, because now there are
two rdz_table classes loaded, and octave thinks they are different.
Why is the class constructor not found? When executing
T1 = rdz_table(1);
the class constructor is loaded from the file, and the octave_value
representing the constructor is stored in the class_constructors member of a
fnc_info_rep object (method fcn_info::fcn_info_rep::load_class_constructor in
file fcn-info.cc). It is also temporarily stored in the function_on_path
member of the same fnc_info_rep object, but then the function_on_path is
restored to its previous value.
I don't understand why function_on_path is restored. I tried to eliminate the
restoring, and I found that it eliminates the problem, while also passing all
the tests. I attach the proposed patch.
(file #52570)
_______________________________________________________
Additional Item Attachment:
File name: bug60791.patch Size:1 KB
<https://file.savannah.gnu.org/file/bug60791.patch?file_id=52570>
_______________________________________________________
Reply to this item at:
<https://savannah.gnu.org/bugs/?60791>
_______________________________________________
Mensaje enviado vía Savannah
https://savannah.gnu.org/
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Octave-bug-tracker] [bug #60791] classdef subsasgn / subsref called incorrectly,
Fernando <=