New GitHub issue #118534 from pizlonator:<br>

<hr>

<pre>
# Bug report

### Bug description:

In `drop_gil()` in ceval_gil.c, there's a check to see if `gil->locked`, but it's loaded using `_Py_atomic_load_ptr_relaxed` instead of `_Py_atomic_load_int_relaxed`. This sort of "works" because:

- `_Py_atomic_load_ptr_relaxed` takes `const void*` rather than something more specific like `const void**`, so the fact that `&git->locked` is an `int*` causes no compiler displeasure.
- It's just an assertion, so the fact that on 64-bit platforms, this loads the adjacent `switch_number` field just means that the assertion won't fire in some cases where it should.

I don't think this is any kind of security issue and it's probably benign, but worth fixing for sanity.

### CPython versions tested on:

CPython main branch

### Operating systems tested on:

macOS
</pre>

<hr>

<a href="https://github.com/python/cpython/issues/118534">View on GitHub</a>
<p>Labels: type-bug</p>
<p>Assignee: </p>