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

    <tr>
        <th>Summary</th>
        <td>
            [libc++] Array access with potentially uninitialized variable in __hash_table::__emplace_unique_key_args
        </td>
    </tr>

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

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

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

<pre>
    Found by compiling with Trunk GCC:

https://github.com/llvm/llvm-project/blob/f9d988f1acde945c5cbdabe468c147492108dc81/libcxx/include/__hash_table#L1997

The ``__chash`` variable is not initialized in all code paths if the following if is false:

https://github.com/llvm/llvm-project/blob/f9d988f1acde945c5cbdabe468c147492108dc81/libcxx/include/__hash_table#L2015

but array will be accessed regardless:

https://github.com/llvm/llvm-project/blob/f9d988f1acde945c5cbdabe468c147492108dc81/libcxx/include/__hash_table#L2023


</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJzNUj1z4yAQ_TVSw8QD6LtQ4SSTa65Mr1lgJRFjSQcojvPrbyXfTXzldZnZEW-BXb33FjWba_syr5Nh6sr0fF6ss9PALjaO7NWv04n9eHpKsmPCnxP-5zvGuIRtT75QDHR1VQeqpcS597_Lw-LnN9SRUuVmRUvfmKauewHaYJMXutDKgMK8rLXIq7yRgtdG12JrYJX--CBgJ-1Wg4S6boQwdhGUozT7KZqmumf1OiJLSk7RdXq7ekvYO3i71TAb2DRHZicbLTj7iYYwA-dIt0G2QBwDsz2L1KifnZsvmxO0QYU9uIDf0gbJRXHPSq2RgfdwpRmSNIUMtMYQSK3HAbxxlHxTJTK7Z5ViK8qSl2XNmzI1bWaarIE02uiwTYrHrWUiH7contlx13zTenu-yxxx2kbtrmyd7sf-9SQm9g8LsiA7dh2eFwcaO6r6tWJ3wmsHfgjp6l37317ZEFYMBIpKVFU6tnmlKo0Sc2Gk1AoqzArTg0RRqAy5SB156MImMZFywgvbWxAmnaltySfJa1GKMheiOWjMNC_KqqlFXyLXSc7xDNYdNh6H2Q-pb3dKah0CHTobYvg6hBDsMOHu6NYf1jjOvn0Dj6cFnf4En-7_b3f-vwG3mVVr">