https://bugs.documentfoundation.org/show_bug.cgi?id=154285

            Bug ID: 154285
           Summary: IsNumeric(1,2) returns True, must produce an error
           Product: LibreOffice
           Version: unspecified
          Hardware: All
                OS: All
            Status: UNCONFIRMED
          Keywords: difficultyBeginner, easyHack, skillCpp
          Severity: normal
          Priority: medium
         Component: BASIC
          Assignee: libreoffice-bugs@lists.freedesktop.org
          Reporter: mikekagan...@hotmail.com

IsNumeric (and some other Basic run-time functions) does not fail when called
with more arguments than it takes. E.g., this gives True:

  IsNumeric(1,2)

The problem is not only strict correctness: people might actually confuse this
notation for testing of a "one and two tenths", while actually it's two integer
arguments passed to the function, and the second argument is simply ignored.
See e.g. bug 123158 comment 8.

The task is to check all the functions in basic/source/runtime/methods.cxx and
basic/source/runtime/methods1.cxx, locate all the function implementations that
do not check the upper bound of the number of arguments passed to them (in case
of IsNumeric, the implementation would be SbRtl_IsNumeric), check if these
functions indeed allow passing arbitrary number of arguments (an example of
such a function, that can rightfully take unlimited number of arguments, is
Array(), and its implementation SbRtl_Array), and for all functions that
*can't* take arbitrary number of arguments, introduce respective check setting
an error.

Every fixed function must have a separate commit, in case when it causes a
regression that requires a revert (who knows). So this is an easyhack which can
be done in parallel, by several people.

-- 
You are receiving this mail because:
You are the assignee for the bug.

Reply via email to