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

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

[Octave-bug-tracker] [bug #58830] imprecise error message for "size(foo,


From: Rik
Subject: [Octave-bug-tracker] [bug #58830] imprecise error message for "size(foo, end)"
Date: Thu, 13 Aug 2020 11:23:29 -0400 (EDT)
User-agent: Mozilla/5.0 (Windows NT 10.0; WOW64; Trident/7.0; rv:11.0) like Gecko

Follow-up Comment #5, bug #58830 (project octave):

I agree that reverting the fix for bug #33637 and introducing a call to
error() would fix the first bug and this one.  However, we would lose
reporting about where the error occurred.  This doesn't seem desirable.  I've
added jwe to the CC list for this bug since he resolved the first one.

The current summary of the bug is that when end is used incorrectly, the
parser returns NaN.  For an indexing operation, this results in eventually
displaying an error about a non-existent variable.  But if it is a function
call, then NaN is used as the parameter.  So,


size (1, end)


is equivalent to


size (1, NaN)


and that throws the error


error: size: requested dimension DIM (= -9223372036854775808) out of range


If we had a way of knowing where we were in parsing (line number and column
number) within the method end() then we could just issue the call to error()
with that information. 


    _______________________________________________________

Reply to this item at:

  <https://savannah.gnu.org/bugs/?58830>

_______________________________________________
  Message sent via Savannah
  https://savannah.gnu.org/




reply via email to

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