[llvm-bugs] [Bug 47636] New: R-value Reference list init causes segfault in CodeGen::tryEmitPrivate

via llvm-bugs llvm-bugs at lists.llvm.org
Thu Sep 24 07:48:06 PDT 2020


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

            Bug ID: 47636
           Summary: R-value Reference list init causes segfault in
                    CodeGen::tryEmitPrivate
           Product: clang
           Version: trunk
          Hardware: PC
                OS: Windows NT
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: C++
          Assignee: unassignedclangbugs at nondot.org
          Reporter: erich.keane at intel.com
                CC: blitzrakete at gmail.com, dgregor at apple.com,
                    erik.pilkington at gmail.com, llvm-bugs at lists.llvm.org,
                    richard-llvm at metafoo.co.uk

The reproducer is just:
int(&&intu_rvref)[]{1,2,3,4};

The handling of tryEmitPrivate assumes that if there are elements in the
initializer, that it is a ConstantArrayType (CAT is not nullptr here:
https://github.com/llvm/llvm-project/blob/master/clang/lib/CodeGen/CGExprConstant.cpp#L2134).

The result is a seg-fault.

Presumably, I could change the getAsConstantArrayType to just getAsArrayType
(and update the test on 2147 to check for ConstantArrayType instead), but I was
unsure if the problem is that the AST itself is being formed incorrectly.

Does anyone have a suggestion?

-- 
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/20200924/c3469612/attachment.html>


More information about the llvm-bugs mailing list