bugGNU Octave - Bugs: bug #52131, lscov fails to run unless all...

 
 

bug #52131: lscov fails to run unless all returned variables are used

Submitted by:  Cody Rude <extremeadin>
Submitted on:  Thu 28 Sep 2017 01:36:01 AM UTC  
 
Category: Octave FunctionSeverity: 3 - Normal
Priority: 5 - NormalItem Group: None
Status: FixedAssigned to: None
Originator Name: Open/Closed: Closed
Release: 4.2.1Operating System: GNU/Linux

Add a New Comment(Rich Markup)
   

You are not logged in

Please log in, so followups can be emailed to you.

 

(Jump to the original submission Jump to the original submission)

Thu 28 Sep 2017 10:50:57 PM UTC, comment #6:

You're welcome!

I'm sure there are a number of other bugs like this which are easy to fix, but no one has stumbled over them or filed a report about them.

Rik <rik5>
Project Administrator
Thu 28 Sep 2017 10:46:24 PM UTC, comment #5:

Thanks for fixing this so fast!

Cody Rude <extremeadin>
Thu 28 Sep 2017 09:11:36 PM UTC, comment #4:

Thanks Pantxo. I changed the patch ever so slightly. I renamed the variable msetmp to just mse. It is okay to create variables, even when they are outputs, if they are truly needed. I pushed the patch here (http://hg.savannah.gnu.org/hgweb/octave/rev/392afc740749). Marking as fixed and closing report.

Rik <rik5>
Project Administrator
Thu 28 Sep 2017 11:31:17 AM UTC, comment #3:

I attached a patch which corrects the behavior so that when no output is requested:

  • "x" is returned anyway and thus assigned to "ans". This is pretty much how all functions work in Octave if they have no effect except returning a value.
  • defines intermediate variables.

(file #41946)

Pantxo Diribarne <pantxo>
Project Member
Thu 28 Sep 2017 01:54:53 AM UTC, comment #2:

I expected the solution, X. That's what the documentation states it will return if only 1 variable is returned.

Cody Rude <extremeadin>
Thu 28 Sep 2017 01:49:45 AM UTC, comment #1:

What answer did you expect from
lscov(A,B)
?

Doug Stewart <dastew>
Thu 28 Sep 2017 01:36:01 AM UTC, original submission:

The function lscov can return 4 results. If all four aren't assigned to a variable, the function will fail to run.

For example,

will fail to run, while the following works

It looks like function only computes some statistics if they will be returned, but one of those statistics is required further down in the function.

I ran this on Ubuntu 16.04, Octave 4.2.1

Cody Rude <extremeadin>

 

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

Attach File(s):
   
   
Comment:
   

Attached Files
file #41946:  lscov_output.patch added by pantxo (1KiB - text/x-patch)

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -unavailable- added by rik5 (Posted a comment)
  • -unavailable- added by pantxo (Updated the item)
  • -unavailable- added by dastew (Posted a comment)
  • -unavailable- added by extremeadin (Submitted the item)
  • -unavailable- added by extremeadin
  •  

    Do you think this task is very important?
    If so, you can click here to add your encouragement to it.
    This task has 0 encouragements so far.

    Only project members can vote.

     

    Please enter the title of George Orwell's famous dystopian book (it's a date):

     

     

    Follow 5 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Thu 28 Sep 2017 09:11:36 PM UTCrik5StatusConfirmed=>Fixed
      Open/ClosedOpen=>Closed
    Thu 28 Sep 2017 11:31:17 AM UTCpantxoAttached File-=>Added lscov_output.patch, #41946
      StatusNone=>Confirmed
    Thu 28 Sep 2017 01:36:01 AM UTCextremeadinCarbon-Copy-=>Added extremeadin

    Back to the top


    Powered by Savane 3.1-cleanup1