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

    <tr>
        <th>Summary</th>
        <td>
            CGHLSLRuntime::initializeBufferFromBinding unconditionally dereferencing RBA after a nullptr check
        </td>
    </tr>

    <tr>
      <th>Labels</th>
      <td>
            new issue
      </td>
    </tr>

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

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

<pre>
    On this line we have a `nullptr` check on `RBA`:

https://github.com/llvm/llvm-project/blob/12ba75145efe3ada44374036d7d5b5e94e855283/clang/lib/CodeGen/CGHLSLRuntime.cpp#L592-L593

but soon after we unconditionally dereference `RBA`:

https://github.com/llvm/llvm-project/blob/12ba75145efe3ada44374036d7d5b5e94e855283/clang/lib/CodeGen/CGHLSLRuntime.cpp#L596-L600

So one of these lines is a bug, I am not sure which it is.

This change was brought in by: https://github.com/llvm/llvm-project/pull/139022 
</pre>
<img width="1" height="1" alt="" src="http://email.email.llvm.org/o/eJzUk09r3DwQxj-NfBmyyCPJjg8-7ObFeQsLhaRfQLLHthqttFhSlu2nL9pNKb0UciwI9GfQ8Dy_mdEx2sUT9UwdmPqv0jmtYevjqmf7VpkwXfuvHtJqIzjrCS4Eq34n0MAa7rNz57SxhsO40vgGwZfnl8OeNZyJPeNlrSmdY7nhwHBYbFqz2Y3hxHBw7v3X9nDewncaE8PBuGAYDjUa3apaKppJ6ElLKVrJRTO1kzKKOkmPSuGjYDiMTvulJLLl41OY6Jl8OT3_f3w9vmSf7Il24_nMUBxVhw9H1Ym7OpMTxBA86DnRVvxlPwY_2WSD185dYaKNZtrIj_RPuGsejg3nd3WvAYInCDOklSLdahjBRtBg8sLwCb6APoEPCWLeCC6rHVewCWzc3TN8K6UfV-0XgouOYLaQlzWB9WCuTOzh0wDO2bkCQHQcEaqpF1MnOl1RX7eKt20rFVZrP4tuFFobNMLoGfmIHFs5IarWYM11ZXvkqHiDslZc1vVuFA2Xs6hnbjTOrWSS00lbtysCdmFbKhtjpr6WSqGqnDbk4q3xET1d4BZliGUOtv6m2uQlMsmdjSn-TpNsctT_gb8AEHvrbbLa2R90yPNM27CF08H6yfrlL21Voi-H_UcHavgYq_tMVXlz_acZ36zEQvnu9b3HnwEAAP__ym082w">