bugGNU Octave - Bugs: bug #65135, setfield internal error on CS-list...

 
 

bug #65135: setfield internal error on CS-list assigment to struct within classdef

Submitter:  Arnaud Delorme <arnodelorme>
Submitted:  Sun 07 Jan 2024 07:58:59 PM UTC
   
 
Category:  Classdef Severity:  3 - Normal
Priority:  5 - Normal Item Group:  Unexpected Error or Warning
Status:  Confirmed Assigned to:  None
Originator Name:  Arno Open/Closed:  * Open
Release:  * 8.4.0 Release: 
Operating System:  * Any Fixed Release:  None
Planned Release:  None
* Mandatory Fields

Add a New Comment Rich Markup
   

Mon 08 Jan 2024 05:37:20 PM UTC, comment #3: 

It wasn't clear whether this fell into the category of something Octave should do, and hence tag as Incorrect Result, or something more optional, and hence Matlab Compatibility.  Seems like the consensus is to treat this as a problem so I have re-tagged as "Unexpected Error or Warning".

Rik <rik5>
Group administrator
Mon 08 Jan 2024 05:09:30 PM UTC, comment #2: 

"Just to point out, the corresponding syntax outside of classdef does work."

I think it should work with a classdef object as well.  Throwing an error here doesn't seem like reasonably different behavior, which is why I changed the item group to incorrect result (or maybe it should be unexpected error).

Either way, I'd really like to limit the use of the compatibility tag for things that Octave already implements in a reasonable way but that happen work differently from Matlab.

John W. Eaton <jwe>
Group administrator
Mon 08 Jan 2024 04:54:03 PM UTC, comment #1: 

Just to point out, the corresponding syntax outside of classdef does work.


val(1).b = 1;
val(2).b = 1;
x = {1 2};
[val.b] = x{:}
val =

  1x2 struct array containing the fields:

    b

val.b
ans = 1
ans = 2


I've attached the two m-files necessary for testing.

(file #55541, file #55542)

Rik <rik5>
Group administrator
Sun 07 Jan 2024 07:58:59 PM UTC, original submission:  

Create this simple object.


classdef SimpleObject
    properties
        Value
    end
end
+verbatim-

Then run the following.

+verbatim+
z = SimpleObject;
z.Value(1).b = 1;
z.Value(2).b = 1;
x = { 1 2 };
[z.Value.b] = x{:};
+verbatim-

This code runs fine on MATLAB (2023b) but generates the following error on Octave 8.4

error: octave_map::setfield: internal error

Arnaud Delorme <arnodelorme>

 

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

Attach Files:
   
   
Comment:
   

Attached Files
file #55541:  SimpleObject.m added by rik5 (55B - text/x-objcsrc)
file #55542:  tst_SimpleObject.m added by rik5 (87B - text/x-objcsrc)

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by rik5 (Updated the item)
  • -email is unavailable- added by jwe (Updated the item)
  • -email is unavailable- added by arnodelorme (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 9 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2024-01-16 rik5 StatusNone Confirmed
        Summarysetfield internal error setfield internal error on CS-list assigment to struct within classdef
    2024-01-08 rik5 Item GroupMatlab Compatibility Unexpected Error or Warning
    2024-01-08 rik5 Attached File- Added SimpleObject.m, #55541
        Attached File- Added tst_SimpleObject.m, #55542
        CategoryInterpreter Classdef
        Item GroupIncorrect Result Matlab Compatibility
        Operating SystemMac OS Any
    2024-01-07 jwe Item GroupMatlab Compatibility Incorrect Result

    Back to the top

    Powered by Savane 3.15-26b0.
    Corresponding source code