<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 `!isNull() && "Cannot retrieve a NULL type pointer""
   href="https://bugs.llvm.org/show_bug.cgi?id=44867">44867</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>Assertion `!isNull() && "Cannot retrieve a NULL type pointer"
          </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>normal
          </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>The valid code can be compiled by gcc but triggered an ice in clang.

POC:
---
main() { **(int(*)[]) !8 / 0; }
---

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" "-o" "tm" "./test1.c"
# Original command:  "/data/rxz226/llvm-project/bld/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"
"/data/rxz226/llvm-project/bld/lib/clang/11.0.0" "-internal-isystem"
"/usr/local/include" "-internal-isystem"
"/data/rxz226/llvm-project/bld/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/c_reduce"
"-ferror-limit" "19" "-fmessage-length" "0" "-fgnuc-version=4.2.1"
"-fobjc-runtime=gcc" "-fdiagnostics-show-option" "-fcolor-diagnostics"
"-faddrsig" "-o" "/tmp/test1-4936bf.o" "-x" "c" "./test1.c"
 "/data/rxz226/llvm-project/bld/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-195d79.c"
---

Stack dump:
---
clang: /home/rxz226/llvm-project/clang/include/clang/AST/Type.h:670: const
clang::ExtQualsTypeCommonBase* clang::QualType
::getCommonPtr() const: Assertion `!isNull() && "Cannot retrieve a NULL type
pointer"' failed.
Stack dump:
0.      Program arguments: /home/rxz226/llvm-project/bld/bin/clang -x c -o tm
./test1.c
1.      ./test1.c:1:31: current parser token '}'
2.      ./test1.c:1:8: parsing function body 'main'
3.      ./test1.c:1:8: in compound statement ('{}')
 #0 0x000000000511679b llvm::sys::PrintStackTrace(llvm::raw_ostream&)
/home/rxz226/llvm-project/llvm/lib/Support/Unix/Sig
nals.inc:564:0
 #1 0x000000000511682e PrintStackTraceSignalHandler(void*)
/home/rxz226/llvm-project/llvm/lib/Support/Unix/Signals.inc:62
5:0
 #2 0x00000000051145b6 llvm::sys::RunSignalHandlers()
/home/rxz226/llvm-project/llvm/lib/Support/Signals.cpp:68:0
 #3 0x0000000005115fd7 llvm::sys::CleanupOnSignal(unsigned long)
/home/rxz226/llvm-project/llvm/lib/Support/Unix/Signals.
inc:361:0
 #4 0x000000000501be1f (anonymous
namespace)::CrashRecoveryContextImpl::HandleCrash(int, unsigned long)
/home/rxz226/llvm
-project/llvm/lib/Support/CrashRecoveryContext.cpp:80:0
 #5 0x000000000501c2fe CrashRecoverySignalHandler(int)
/home/rxz226/llvm-project/llvm/lib/Support/CrashRecoveryContext.cp
p:362:0
 #6 0x00007fdf1bcd6390 __restore_rt
(/lib/x86_64-linux-gnu/libpthread.so.0+0x11390)
 #7 0x00007fdf1a9e5428 raise
/build/glibc-LK5gWL/glibc-2.23/signal/../sysdeps/unix/sysv/linux/raise.c:54:0
 #8 0x00007fdf1a9e702a abort /build/glibc-LK5gWL/glibc-2.23/stdlib/abort.c:91:0
 #9 0x00007fdf1a9ddbd7 __assert_fail_base
/build/glibc-LK5gWL/glibc-2.23/assert/assert.c:92:0
#10 0x00007fdf1a9ddc82 (/lib/x86_64-linux-gnu/libc.so.6+0x2dc82)
#11 0x00000000053ea7d3 clang::QualType::getCommonPtr() const
/home/rxz226/llvm-project/clang/include/clang/AST/Type.h:671
:0
#12 0x00000000053ebdd8 clang::QualType::getTypePtr() const
/home/rxz226/llvm-project/clang/include/clang/AST/Type.h:6257:
0
...
---</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>