<table border="1" cellspacing="0" cellpadding="8">
    <tr>
        <th>Issue</th>
        <td>
            <a href=https://github.com/llvm/llvm-project/issues/150707>150707</a>
        </td>
    </tr>

    <tr>
        <th>Summary</th>
        <td>
            [Clang] Trap reasons null check
        </td>
    </tr>

    <tr>
      <th>Labels</th>
      <td>
            clang
      </td>
    </tr>

    <tr>
      <th>Assignees</th>
      <td>
      </td>
    </tr>

    <tr>
      <th>Reporter</th>
      <td>
          anthonyhatran
      </td>
    </tr>
</table>

<pre>
    As of current, a null check is in place for emitting trap reasons via the `-fsanitize-trap=` flag (trap reasons can be disabled with `-fno-sanitize-debug-info-traps`). This is to prevent a nullptr dereference since clang will sometimes emit a UBSan trap into the prologue of a function when debug-info locations aren't defined.

Test case here with more details:
`clang/test/CodeGen/ubsan-trap-reason-crash.cpp`.

[not upstream yet, will edit this line out once upstream]
</pre>
<img width="1" height="1" alt="" src="http://email.email.llvm.org/o/eJxUks2ypCgQhZ8GNxlWIJalLlzcn3AeYO48QAqpMoNgQFo37jx9B1Z13-6NLsg8nPNxMCW7eKJBNK-ieS_w4DXEAT2vwX-tyBF9MQXzNbwkCDPoI0byLNQbIPjDOdAr6f_AJrAedoeaYA4RaLPM1i_AEXeIhCn4BHeLwCuBuMlyTugt2_-pzCOifhc3CbPDBYTq_tjS6GEiMDbh5MjAp-X1IeFD-UvF0HQspfVzOAWTuEmh-gt8rNlbAg6wR7qT56fznSMYijRTJK8Jks1f7dAv8GmdgxQ2YrtROtMAwj-vf6N_JLKewxllj8GF5aAMB2E-vGYbPHyu5OHbErigMR8kwEheqJbB0Gw9mYuQL0K-fFBi0JgIVor0yLiFSGCI0bok6jwlbvI0KNTIlFio8S0Y-isrjseU0J_Zywe5UkdM60Xvu7jJ5zWiefWB4dgTR8INvuh8yzMvGcvAGZezniAcDCEj-Tmc-2GG2vR1jwUNVdvU17Zr-q5YB6kVNarXnZkrda3bfq66Svb1tbliI3VX2EFJ1chWNapSddVdjOqNrGRrlDRq6jpxlbShdRfn7tslxKWwKR00VI1sZVs4nMils6ZKPRmo7CgOeaGcjiWJq3Q2cfqWYMvu7PbbudG8w8fvzfoucHFEN6zM-wlajUKNi-X1mC46bEKNWfH5K_cY_iWd4Z8Ok1Dj0-R9UD8CAAD__3mtG_k">