[llvm-bugs] [Bug 26349] New: Digit separators as only characters in significand or exponent of floating point constants can trigger assertions

via llvm-bugs llvm-bugs at lists.llvm.org
Wed Jan 27 22:35:06 PST 2016


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

            Bug ID: 26349
           Summary: Digit separators as only characters in significand or
                    exponent of floating point constants can trigger
                    assertions
           Product: clang
           Version: trunk
          Hardware: All
                OS: All
            Status: NEW
          Severity: normal
          Priority: P
         Component: C++14
          Assignee: unassignedclangbugs at nondot.org
          Reporter: craig.topper at gmail.com
                CC: llvm-bugs at lists.llvm.org
    Classification: Unclassified

The following literals trick NumericLiteralParser into believing that they have
an exponent or significand when they don't. Later when GetFloatValue tries to
process them the empty exponent or significand is detected and triggers an
assertion.

They also diagnose the digit separator as being both at the start and end of a
digit sequence.

float f = 0x.'p1f;
float g = 0e'f;

This one doesn't trigger an assertion, but isn't diagnosed as an empty exponent
either.

float h = 0x0p'f;

-- 
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/20160128/06078089/attachment.html>


More information about the llvm-bugs mailing list