Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 06 Apr 2018 18:53:41 +0000
From:      bugzilla-noreply@freebsd.org
To:        bugs@FreeBSD.org
Subject:   [Bug 227329] [PATCH] bin/expr: do not fail with "overflow" if no overflow occurs
Message-ID:  <bug-227329-227@https.bugs.freebsd.org/bugzilla/>

index | next in thread | raw e-mail

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@FreeBSD.org
          Reporter: tobias@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.

home | help

Want to link to this message? Use this
URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?bug-227329-227>