bugGNU Octave - Bugs: bug #65308, bytecode interpreter: incorrect...

 
 

bug #65308: bytecode interpreter: incorrect number of output arguments

Submitter:  Fernando <tutissanalio>
Submitted:  Tue 13 Feb 2024 06:43:59 PM UTC
   
 
Category:  Interpreter Severity:  3 - Normal
Priority:  5 - Normal Item Group:  Missed Error or Warning
Status:  None Assigned to:  None
Originator Name:  Open/Closed:  * Open
Release:  * dev Operating System:  * Any
Fixed Release:  None Planned Release:  None
* Mandatory Fields

Add a New Comment Rich Markup
   

Thu 15 Feb 2024 09:32:20 PM UTC, comment #4: 

Yes, it solves the issue. Thank you.

Fernando <tutissanalio>
Wed 14 Feb 2024 11:04:00 PM UTC, comment #3: 

The attached patch should solve the issue. It was a more shallow problem than I thought.


Fix cs-list escape from matrix in bytecode interpreter (bug #65308)

A '{:}' expansion inside a matrix inside an anonymous function made
the cs-list escape the matrix when nargout was not 1, due to the
expansion inheriting the nargout value from the parent function.

Check the "special nargout -1" flag is not active, before pushing
any "inherit nargout from parent function" opcode.

* pt-bytecode-walk.cc: Chech flag
* bytecode_anon_handles.m: Add test


(file #55705)

Petter <petter>
Tue 13 Feb 2024 10:53:14 PM UTC, comment #2: 

I can reproduce it. I'll try to figure something out. There is https://savannah.gnu.org/bugs/?64783 too, so "anon function returns with cs-list" probably need some overhaul for the bytecode interpreter.

Petter <petter>
Tue 13 Feb 2024 06:46:43 PM UTC, comment #1: 

I forgot to specify in the title and description that this happens only with anonymous functions.

Fernando <tutissanalio>
Tue 13 Feb 2024 06:43:59 PM UTC, original submission:  

While investigating bug #64783, I found another bug in the bytecode interpreter, related to the number of output arguments.


>> __vm_enable__ (1)
>> f=@(x)[x{:}];
>> [a,b]=f({5,9})
a = 5
b = 9


Note that this should give an error (we are asking 2 outputs from f, but f should return only 1 output vector). Disabling the bytecode interpreter produces the correct result.


>> __vm_enable__ (0)
>> f=@(x)[x{:}];
>> [a,b]=f({5,9})
a =
   5   9

error: element number 2 undefined in return list


Fernando <tutissanalio>

 

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

Attach Files:
   
   
Comment:
   

Attached Files
file #55705:  octave_33192.patch added by petter (3KiB - text/plain)

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by petter (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.

     

    Follows 1 latest change.

    Date Changed by Updated Field Previous Value => Replaced by
    2024-02-14 petter Attached File- Added octave_33192.patch, #55705

    Back to the top

    Powered by Savane 3.13-02a9.
    Corresponding source code