[llvm-bugs] [Bug 40779] New: clang trunk thinks 1+1 is 9223372036854775810 (converting `long double` to `size_t`)

via llvm-bugs llvm-bugs at lists.llvm.org
Tue Feb 19 11:17:50 PST 2019


https://bugs.llvm.org/show_bug.cgi?id=40779

            Bug ID: 40779
           Summary: clang trunk thinks 1+1 is 9223372036854775810
                    (converting `long double` to `size_t`)
           Product: new-bugs
           Version: unspecified
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: new bugs
          Assignee: unassignedbugs at nondot.org
          Reporter: dholbert at mozilla.com
                CC: htmldeveloper at gmail.com, llvm-bugs at lists.llvm.org

Created attachment 21493
  --> https://bugs.llvm.org/attachment.cgi?id=21493&action=edit
testcase

STR:
 1. Compile and run the attached testcase program, the key part of which is
here:
>  long double one = 1;
>  size_t result(one + 1); // This should equal 2.


ACTUAL RESULTS, with locally-built clang version 9.0.0 (trunk 354359):
The program prints:
> Failed (expected 2 and got 9223372036854775810)

EXPECTED RESULTS:
The program should print:
> Success (expected 2 and got 2)


This is causing a startup crash in my locally-built Firefox, compiled with
locally-built Clang (from llvm trunk 354359).

-- 
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20190219/fdd91bd1/attachment.html>


More information about the llvm-bugs mailing list