Closed
Description
Bug report
Bug description:
In https://github.com/python/cpython/pull/130708/files#r2005817604
we want to replace an input variable, writing v = PyStackRef_MakeHeapSafe(v);
but the code generator rejects this as unsafe: "writing to an input variable".
This mostly a good restriction as we don't want to accidentally lose a reference, but we should allow the replacement when it is safe.
This should be allowed:
tmp = PyStackRef_MakeHeapSafe(v);
DEAD(v);
v = tmp;
As we only write to a dead variable, which is safe.
CPython versions tested on:
CPython main branch
Operating systems tested on:
No response