[Bug 227329] [PATCH] bin/expr: do not fail with "overflow" if no overflow occurs

bugzilla-noreply at freebsd.org bugzilla-noreply at freebsd.org
Fri Apr 6 18:53:43 UTC 2018


https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=227329

            Bug ID: 227329
           Summary: [PATCH] bin/expr: do not fail with "overflow" if no
                    overflow occurs
           Product: Base System
           Version: CURRENT
          Hardware: Any
                OS: Any
            Status: New
          Severity: Affects Only Me
          Priority: ---
         Component: bin
          Assignee: bugs at FreeBSD.org
          Reporter: tobias at stoeckmann.org

Created attachment 192294
  --> https://bugs.freebsd.org/bugzilla/attachment.cgi?id=192294&action=edit
Patch to fix the issue

It is possible to trigger an overflow error message with expr, even though no
overflow would occur:

$ expr -- -36854775800 - \( -9223372036854775807 - 1 \)
expr: overflow
$ _

The function assert_minus() verifies subtraction in an invert addition case,
which is not correct.

See also the OpenBSD discussion here:
https://marc.info/?l=openbsd-tech&m=152245790622327&w=2

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


More information about the freebsd-bugs mailing list