mirror of
https://github.com/zrax/pycdc.git
synced 2026-06-23 11:34:07 +00:00
Fix LOAD_GLOBAL and cell var references in Python 3.11+
This commit is contained in:
parent
379c0c94d0
commit
5d855f0bd2
4 changed files with 30 additions and 12 deletions
10
pyc_code.cpp
10
pyc_code.cpp
|
|
@ -87,3 +87,13 @@ void PycCode::load(PycData* stream, PycModule* mod)
|
|||
else
|
||||
m_exceptTable = new PycString;
|
||||
}
|
||||
|
||||
PycRef<PycString> PycCode::getCellVar(PycModule* mod, int idx) const
|
||||
{
|
||||
if (mod->verCompare(3, 11) >= 0)
|
||||
return getLocal(idx);
|
||||
|
||||
return (idx >= m_cellVars->size())
|
||||
? m_freeVars->get(idx - m_cellVars->size()).cast<PycString>()
|
||||
: m_cellVars->get(idx).cast<PycString>();
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue