octave-bug-tracker
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Octave-bug-tracker] [bug #44779] copy-on-write, varargin, and classdef:


From: Carnë Draug
Subject: [Octave-bug-tracker] [bug #44779] copy-on-write, varargin, and classdef: invalid dimension inquiry of a non-existent value
Date: Wed, 08 Apr 2015 16:46:36 +0000
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Firefox/31.0 Iceweasel/31.5.3

URL:
  <http://savannah.gnu.org/bugs/?44779>

                 Summary: copy-on-write, varargin, and classdef: invalid
dimension inquiry of a non-existent value
                 Project: GNU Octave
            Submitted by: carandraug
            Submitted on: Wed 08 Apr 2015 16:46:35 GMT
                Category: Interpreter
                Severity: 3 - Normal
                Priority: 5 - Normal
              Item Group: None
                  Status: None
             Assigned to: None
         Originator Name: 
        Originator Email: 
             Open/Closed: Open
         Discussion Lock: Any
                 Release: 4.0.0-rc2
        Operating System: GNU/Linux

    _______________________________________________________

Details:

First, apologies for the cryptic bug title but I just have no idea from where
it comes from. Here's how to duplicate it:


octave-gui:1>
function foobar (varargin)
  p = inputParser ();
  p.addParamValue ("foo", "bar", @ischar);
  p.parse (varargin{2:end});
endfunction
octave-gui:2> foobar ([], "foo", "qux")
error: invalid dimension inquiry of a non-existent value
error: called from
    foobar at line 4 column 3


Note that the end does not happen inside inputParse, I have checked by debug
printing, and it's not a statement at inputParser::parse that's throwing the
error.

I'm not sure this is completely a classdef bug because it won't be triggered
if varargin is copied into a new variable:


octave-gui:1>
function foobar (varargin)
  p = inputParser ();
  p.addParamValue ("foo", "bar", @ischar);
  args = varargin(2:end);
  p.parse (args{:});
endfunction
octave-gui:2> foobar ([], "foo", "qux")


if index does not use "end":


function foobar (varargin)
  p = inputParser ();
  p.addParamValue ("foo", "bar", @ischar);
  p.parse (varargin{2:3})
endfunction
octave-gui:2> foobar ([], "foo", "qux")


or if simply using ":" to parse all of varargin:


octave-gui:1> function foobar (varargin)
  p = inputParser ();
  p.addParamValue ("foo", "bar", @ischar);
  p.parse (varargin{:})
endfunction
octave-gui:2> foobar("foo", "qux")






    _______________________________________________________

Reply to this item at:

  <http://savannah.gnu.org/bugs/?44779>

_______________________________________________
  Message sent via/by Savannah
  http://savannah.gnu.org/




reply via email to

[Prev in Thread] Current Thread [Next in Thread]