<html>
    <head>
      <base href="https://bugs.llvm.org/">
    </head>
    <body><table border="1" cellspacing="0" cellpadding="8">
        <tr>
          <th>Bug ID</th>
          <td><a class="bz_bug_link 
          bz_status_NEW "
   title="NEW - Assertion `(EltTy->isDependentType() || EltTy->isIncompleteType() || EltTy->isConstantSizeType()) && "Constant array of VLAs is illegal!"' failed."
   href="https://bugs.llvm.org/show_bug.cgi?id=44738">44738</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>Assertion `(EltTy->isDependentType() || EltTy->isIncompleteType() || EltTy->isConstantSizeType()) && "Constant array of VLAs is illegal!"' failed.
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>clang
          </td>
        </tr>

        <tr>
          <th>Version</th>
          <td>trunk
          </td>
        </tr>

        <tr>
          <th>Hardware</th>
          <td>PC
          </td>
        </tr>

        <tr>
          <th>OS</th>
          <td>All
          </td>
        </tr>

        <tr>
          <th>Status</th>
          <td>NEW
          </td>
        </tr>

        <tr>
          <th>Severity</th>
          <td>enhancement
          </td>
        </tr>

        <tr>
          <th>Priority</th>
          <td>P
          </td>
        </tr>

        <tr>
          <th>Component</th>
          <td>-New Bugs
          </td>
        </tr>

        <tr>
          <th>Assignee</th>
          <td>unassignedclangbugs@nondot.org
          </td>
        </tr>

        <tr>
          <th>Reporter</th>
          <td>changochen1@gmail.com
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>htmldeveloper@gmail.com, llvm-bugs@lists.llvm.org, neeilans@live.com, richard-llvm@metafoo.co.uk
          </td>
        </tr></table>
      <p>
        <div>
        <pre>POC:
---
# 1 "<built-in>"
# 1 "test1.c"
b() {
  int a[][c()] = {}
---

Run script:
---
# Crash reproducer for clang version 11.0.0
(<a href="https://github.com/llvm/llvm-project.git">https://github.com/llvm/llvm-project.git</a>
56b7f595d2b402ff177ca42214325c8fdea10fb0)
# Driver args: "-x" "c" "test1.c" "-o" "test"
# Original command:  "/home/rxz226/llvm-project/bld_instru/bin/clang-11" "-cc1"
"-triple" "x86_64-unknown-linux-gnu" "-emit-obj" "-mrelax-all" "-disable-free"
"-main-file-name" "test1.c" "-mrelocation-model" "static" "-mthread-model"
"posix" "-mframe-pointer=all" "-fmath-errno" "-fno-rounding-math"
"-masm-verbose" "-mconstructor-aliases" "-munwind-tables" "-target-cpu"
"x86-64" "-dwarf-column-info" "-fno-split-dwarf-inlining"
"-debugger-tuning=gdb" "-resource-dir"
"/home/rxz226/llvm-project/bld_instru/lib/clang/11.0.0" "-internal-isystem"
"/usr/local/include" "-internal-isystem"
"/home/rxz226/llvm-project/bld_instru/lib/clang/11.0.0/include"
"-internal-externc-isystem" "/usr/include/x86_64-linux-gnu"
"-internal-externc-isystem" "/include" "-internal-externc-isystem"
"/usr/include" "-fdebug-compilation-dir" "/home/rxz226/fuzz_clang1/hangs/test"
"-ferror-limit" "19" "-fmessage-length" "0" "-fgnuc-version=4.2.1"
"-fobjc-runtime=gcc" "-fdiagnostics-show-option" "-fcolor-diagnostics"
"-faddrsig" "-o" "/tmp/test1-b92dad.o" "-x" "c" "test1.c"
 "/home/rxz226/llvm-project/bld_instru/bin/clang-11" "-cc1" "-triple"
"x86_64-unknown-linux-gnu" "-emit-obj" "-mrelax-all" "-disable-free"
"-main-file-name" "test1.c" "-mrelocation-model" "static" "-mthread-model"
"posix" "-mframe-pointer=all" "-fmath-errno" "-fno-rounding-math"
"-masm-verbose" "-mconstructor-aliases" "-munwind-tables" "-target-cpu"
"x86-64" "-dwarf-column-info" "-fno-split-dwarf-inlining"
"-debugger-tuning=gdb" "-ferror-limit" "19" "-fmessage-length" "0"
"-fgnuc-version=4.2.1" "-fobjc-runtime=gcc" "-fdiagnostics-show-option"
"-fcolor-diagnostics" "-faddrsig" "-x" "c" "test1-af8ec3.c"
---

Stack dump:
---
 #0 0x000000000681faf6 llvm::sys::PrintStackTrace(llvm::raw_ostream&)
/home/rxz226/llvm-project/llvm/lib/Support/Unix/Signals.inc:560:7
 #1 0x000000000681ac5e llvm::sys::RunSignalHandlers()
/home/rxz226/llvm-project/llvm/lib/Support/Signals.cpp:69:18
 #2 0x000000000681dd30 llvm::sys::CleanupOnSignal(unsigned long)
/home/rxz226/llvm-project/llvm/lib/Support/Unix/Signals.inc:361:3
 #3 0x000000000662a5aa (anonymous
namespace)::CrashRecoveryContextImpl::HandleCrash(int, unsigned long)
/home/rxz226/llvm-project/llvm/lib/Support/CrashRecoveryContext.cpp:80:5
 #4 0x000000000662a9e6
/home/rxz226/llvm-project/llvm/lib/Support/CrashRecoveryContext.cpp:361:51
 #5 0x00007fbe9041a390 __restore_rt
(/lib/x86_64-linux-gnu/libpthread.so.0+0x11390)
 #6 0x00007fbe8ef84428 raise
/build/glibc-LK5gWL/glibc-2.23/signal/../sysdeps/unix/sysv/linux/raise.c:54:0
 #7 0x00007fbe8ef8602a abort /build/glibc-LK5gWL/glibc-2.23/stdlib/abort.c:91:0
 #8 0x00007fbe8ef7cbd7 __assert_fail_base
/build/glibc-LK5gWL/glibc-2.23/assert/assert.c:92:0
 #9 0x00007fbe8ef7cc82 (/lib/x86_64-linux-gnu/libc.so.6+0x2dc82)
#10 0x000000000ddbdf59
(/home/rxz226/llvm-project/bld_instru/bin/clang+0xddbdf59)
#11 0x000000000cb4ceb6 (anonymous
namespace)::InitListChecker::CheckArrayType(clang::InitializedEntity const&,
clang::InitListExpr*, clang::QualType&, llvm::APSInt, bool, unsigned int&,
clang::InitListExpr*, unsigned int&) /home
/rxz226/llvm-project/clang/lib/Sema/SemaInit.cpp:1938:14
#12 0x000000000cb45a54 llvm::APInt::~APInt()
/home/rxz226/llvm-project/llvm/include/llvm/ADT/APInt.h:0:0
#13 0x000000000cb45a54 (anonymous
namespace)::InitListChecker::CheckListElementTypes(clang::InitializedEntity
const&, clang::InitListExpr*, clang::QualType&, bool, unsigned int&,
clang::InitListExpr*, unsigned int&, bool) /home/
rxz226/llvm-project/clang/lib/Sema/SemaInit.cpp:1280:0
#14 0x000000000cb0293b (anonymous
namespace)::InitListChecker::CheckExplicitInitList(clang::InitializedEntity
const&, clang::InitListExpr*, clang::QualType&, clang::InitListExpr*, bool)
/home/rxz226/llvm-project/clang/lib/Sema/S
emaInit.cpp:1177:7
#15 0x000000000cb0293b (anonymous
namespace)::InitListChecker::InitListChecker(clang::Sema&,
clang::InitializedEntity const&, clang::InitListExpr*, clang::QualType&, bool,
bool, bool) /home/rxz226/llvm-project/clang/lib/Sema/Sem
aInit.cpp:953:0
#16 0x000000000cb22dce clang::InitializationSequence::Perform(clang::Sema&,
clang::InitializedEntity const&, clang::InitializationKind const&,
llvm::MutableArrayRef<clang::Expr*>, clang::QualType*)
/home/rxz226/llvm-project/clan
g/lib/Sema/SemaInit.cpp:8203:23
#17 0x000000000c174389 clang::Sema::AddInitializerToDecl(clang::Decl*,
clang::Expr*, bool)
/home/rxz226/llvm-project/clang/lib/Sema/SemaDecl.cpp:11858:33
#18 0x000000000bc15c12
clang::Parser::ParseDeclarationAfterDeclaratorAndAttributes(clang::Declarator&,
clang::Parser::ParsedTemplateInfo const&, clang::Parser::ForRangeInit*)
/home/rxz226/llvm-project/clang/lib/Parse/ParseDecl.c
pp:0:17
#19 0x000000000bc10989 clang::Parser::ParseDeclGroup(clang::ParsingDeclSpec&,
clang::DeclaratorContext, clang::SourceLocation*, clang::Parser::ForRangeInit*)
/home/rxz226/llvm-project/clang/lib/Parse/ParseDecl.cpp:2128:9
...
---</pre>
        </div>
      </p>


      <hr>
      <span>You are receiving this mail because:</span>

      <ul>
          <li>You are on the CC list for the bug.</li>
      </ul>
    </body>
</html>