[Bug 141] New: Signed integer overflow handled incorrectly

via D.gnu d.gnu at puremagic.com
Thu Jul 17 04:55:13 PDT 2014


http://bugzilla.gdcproject.org/show_bug.cgi?id=141

            Bug ID: 141
           Summary: Signed integer overflow handled incorrectly
           Product: GDC
           Version: 4.9.x
          Hardware: All
                OS: All
            Status: NEW
          Severity: critical
          Priority: Normal
         Component: gdc
          Assignee: ibuclaw at gdcproject.org
          Reporter: code at klickverbot.at

This
---
bool foo(int a) {
  return a > (a + 1);
}
---
produces
---
_D4test3fooFiZb:
    xorl    %eax, %eax
    ret
---
using the GDC 4.9.0 from the Arch Linux repositories.

However, the spec (http://dlang.org/expression.html) says: "If both operands
are of integral types and an overflow or underflow occurs in the computation,
wrapping will happen." There is no mention that this does not apply to signed
integral types as well.

-- 
You are receiving this mail because:
You are watching all bug changes.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.puremagic.com/pipermail/d.gnu/attachments/20140717/f784ddb3/attachment.html>


More information about the D.gnu mailing list