[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Octave-bug-tracker] [bug #63841] nargout is always 0 or 1 for subsref()
From: |
Rik |
Subject: |
[Octave-bug-tracker] [bug #63841] nargout is always 0 or 1 for subsref() in classdef methods |
Date: |
Mon, 27 Feb 2023 11:58:00 -0500 (EST) |
Follow-up Comment #10, bug #63841 (project octave):
I don't pretend this is brilliant, but this patch seems to fix the case for
the two reported bugs.
diff --git a/libinterp/octave-value/ov-classdef.cc
b/libinterp/octave-value/ov-classdef.cc
--- a/libinterp/octave-value/ov-classdef.cc
+++ b/libinterp/octave-value/ov-classdef.cc
@@ -102,8 +102,9 @@ octave_classdef::subsref (const std::str
{
// Set up a proper nargout for the subsref call by calling
numel.
octave_value_list tmp;
- if (type[0] != '.') tmp = idx.front ();
- nargout = xnumel (tmp);
+ if (type[0] != '.')
+ tmp = idx.front ();
+ nargout = std::max (static_cast<int> (xnumel (tmp)), nargout);
}
retval = meth.execute (args, nargout, true, "subsref");
All it does is use the maximum value for nargout which is either the number of
output variables asked for by the interpeter (nargout input parameter to
function) or the maximum number of outputs for a varargout expression taken
from the index operation.
(file #54400)
_______________________________________________________
Additional Item Attachment:
File name: patch.63841 Size:0 KB
<https://file.savannah.gnu.org/file/patch.63841?file_id=54400>
_______________________________________________________
Reply to this item at:
<https://savannah.gnu.org/bugs/?63841>
_______________________________________________
Message sent via Savannah
https://savannah.gnu.org/
- [Octave-bug-tracker] [bug #63841] nargout is always 1 for classdef methods, (continued)
- [Octave-bug-tracker] [bug #63841] nargout is always 1 for classdef methods, Rik, 2023/02/26
- [Octave-bug-tracker] [bug #63841] nargout is always 1 for classdef methods, Rik, 2023/02/26
- [Octave-bug-tracker] [bug #63841] nargout is always 1 for classdef methods, Nicholas Jankowski, 2023/02/26
- [Octave-bug-tracker] [bug #63841] nargout is always 0 or 1 for subsref() in classdef methods, Rik, 2023/02/26
- [Octave-bug-tracker] [bug #63841] nargout is always 0 or 1 for subsref() in classdef methods, Rik, 2023/02/26
- [Octave-bug-tracker] [bug #63841] nargout is always 0 or 1 for subsref() in classdef methods, Rik, 2023/02/26
- [Octave-bug-tracker] [bug #63841] nargout is always 0 or 1 for subsref() in classdef methods, anonymous, 2023/02/26
- Message not available
- [Octave-bug-tracker] [bug #63841] nargout is always 0 or 1 for subsref() in classdef methods, John W. Eaton, 2023/02/27
- Message not available
- Message not available
- [Octave-bug-tracker] [bug #63841] nargout is always 0 or 1 for subsref() in classdef methods, A.R. Burgers, 2023/02/27
- [Octave-bug-tracker] [bug #63841] nargout is always 0 or 1 for subsref() in classdef methods, Rik, 2023/02/27
- [Octave-bug-tracker] [bug #63841] nargout is always 0 or 1 for subsref() in classdef methods,
Rik <=
- [Octave-bug-tracker] [bug #63841] nargout is always 0 or 1 for subsref() in classdef methods, Rik, 2023/02/27