bugGNU Octave - Bugs: bug #58751, Calling an undefined function...

 
 

bug #58751: Calling an undefined function ignoring first output value throws strange error message

Submitter:  Fernando <tutissanalio>
Submitted:  Sat 11 Jul 2020 06:42:30 PM UTC
   
 
Category:  Interpreter Severity:  3 - Normal
Priority:  5 - Normal Item Group:  Unexpected Error or Warning
Status:  Fixed Assigned to:  None
Originator Name:  Open/Closed:  * Closed
Release:  * 6.0.90 Operating System:  * Any
Fixed Release:  None Planned Release:  None
* Mandatory Fields

Add a New Comment Rich Markup
   

Mon 13 Jul 2020 08:14:08 AM UTC, comment #3: 

Thank you. I think status can be changed to "Ready for Test" now.

Fernando <tutissanalio>
Sun 12 Jul 2020 09:09:44 PM UTC, comment #2: 

I pushed the following changeset on stable and merged with default:

http://hg.savannah.gnu.org/hgweb/octave/rev/af1a9c1db88e

John W. Eaton <jwe>
Group administrator
Sat 11 Jul 2020 10:38:45 PM UTC, comment #1: 

It seems that the problem is that the lvalue list is not updated correctly. The statement


[~,b]=non_existing


causes an error and, because of that, the function _unimplemented_ is called, but the lvalue list "[~,b]" is kept while executing the statements of _unimplemented_

This could also be the cause of bug  #58748.

I attach a possible patch to correct this.


(file #49473)

Fernando <tutissanalio>
Sat 11 Jul 2020 06:42:30 PM UTC, original submission:  

The following happens in Octave 6.0.1 (hg id: 7a17dfa7716d)


>> [~,b]=non_existing         % non_existing does not exist
error: if: undefined value used in conditional expression
error: called from
    __unimplemented__ at line 520 column 9


Of course, an error should be thrown, but the error error message is very strange. If the first output is not ignored, the error message is correct:


>> non_existing
error: 'non_existing' undefined near line 1, column 1
>> [a,b]=non_existing
error: 'non_existing' undefined near line 1, column 1
>> [a,~]=non_existing
error: 'non_existing' undefined near line 1, column 1


The problem also happens if the function is defined but does not give a value for its second output argument. For example:


>> function [a,b]=f(msg), a=msg; end
>> [~,b]=f('something')
error: if: undefined value used in conditional expression
error: called from
    __unimplemented__ at line 520 column 9



Fernando <tutissanalio>

 

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

Attach Files:
   
   
Comment:
   

Attached Files
file #49473:  bug58751.patch added by tutissanalio (908B - text/x-patch)

 

Depends on the following items: None found

Items that depend on this one: None found

 

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

     

    Follow 4 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2020-07-27 jwe StatusReady For Test Fixed
        Open/ClosedOpen Closed
    2020-07-13 jwe StatusNone Ready For Test
    2020-07-11 tutissanalio Attached File- Added bug58751.patch, #49473

    Back to the top

    Powered by Savane 3.13-caa5.
    Corresponding source code