[llvm-bugs] [Bug 45333] New: r372359 causes stack overflow parsing large array

via llvm-bugs llvm-bugs at lists.llvm.org
Fri Mar 27 18:36:33 PDT 2020


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

            Bug ID: 45333
           Summary: r372359 causes stack overflow parsing large array
           Product: clang
           Version: 10.0
          Hardware: PC
                OS: All
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: Frontend
          Assignee: unassignedclangbugs at nondot.org
          Reporter: smeenai at fb.com
                CC: llvm-bugs at lists.llvm.org, neeilans at live.com,
                    richard-llvm at metafoo.co.uk, tstellar at redhat.com
            Blocks: 45309

We have some generated code which creates a large std::array. After r372359,
clang appears to call AnalyzeImplicitConversions recursively for each array
element, which leads to a stack overflow for a sufficiently large array. Simple
repro:

$ python -c "print '#include <array>\n static constexpr std::array a {\n  %s
\n};' % ',\n  '.join(['0.0f']*65536)" > /tmp/test.cpp
$ clang -std=c++17 -fsyntax-only /tmp/test.cpp

Explicitly passing the size of the array (std::array<float, n>) avoids this,
but it's still a regression from Clang 9.


Referenced Bugs:

https://bugs.llvm.org/show_bug.cgi?id=45309
[Bug 45309] [meta] 10.0.1 Release Blockers
-- 
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/20200328/0530e129/attachment-0001.html>


More information about the llvm-bugs mailing list