Skip to content

r372359 causes stack overflow parsing large array #44678

@smeenai

Description

@smeenai
Bugzilla Link 45333
Resolution FIXED
Resolved on Jun 26, 2020 13:51
Version 10.0
OS All
Blocks #44654
CC @jwf,@mclow,@tambry,@zygoloid,@tstellar
Fixed by commit(s) c6eb584 77d76b7

Extended Description

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 \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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugzillaIssues migrated from bugzillaclang:frontendLanguage frontend issues, e.g. anything involving "Sema"

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions