mirror of
https://github.com/zrax/pycdc.git
synced 2026-06-23 11:34:07 +00:00
Merge <3.11 VarNames and >=3.11 Locals+Names into a single variable for simplicity.
Also cleans up some extra verbose output by making extra PyCode fields optional
This commit is contained in:
parent
dfb0a976c5
commit
379c0c94d0
6 changed files with 46 additions and 47 deletions
21
pyc_code.cpp
21
pyc_code.cpp
|
|
@ -44,10 +44,15 @@ void PycCode::load(PycData* stream, PycModule* mod)
|
|||
m_consts = LoadObject(stream, mod).cast<PycSequence>();
|
||||
m_names = LoadObject(stream, mod).cast<PycSequence>();
|
||||
|
||||
if (mod->verCompare(1, 3) >= 0 && mod->verCompare(3, 11) < 0)
|
||||
m_varNames = LoadObject(stream, mod).cast<PycSequence>();
|
||||
if (mod->verCompare(1, 3) >= 0)
|
||||
m_localNames = LoadObject(stream, mod).cast<PycSequence>();
|
||||
else
|
||||
m_varNames = new PycTuple;
|
||||
m_localNames = new PycTuple;
|
||||
|
||||
if (mod->verCompare(3, 11) >= 0)
|
||||
m_localKinds = LoadObject(stream, mod).cast<PycString>();
|
||||
else
|
||||
m_localKinds = new PycString;
|
||||
|
||||
if (mod->verCompare(2, 1) >= 0 && mod->verCompare(3, 11) < 0)
|
||||
m_freeVars = LoadObject(stream, mod).cast<PycSequence>();
|
||||
|
|
@ -59,16 +64,6 @@ void PycCode::load(PycData* stream, PycModule* mod)
|
|||
else
|
||||
m_cellVars = new PycTuple;
|
||||
|
||||
if (mod->verCompare(3, 11) >= 0)
|
||||
m_localsAndNames = LoadObject(stream, mod).cast<PycSequence>();
|
||||
else
|
||||
m_localsAndNames = new PycTuple;
|
||||
|
||||
if (mod->verCompare(3, 11) >= 0)
|
||||
m_localsAndKinds = LoadObject(stream, mod).cast<PycString>();
|
||||
else
|
||||
m_localsAndKinds = new PycString;
|
||||
|
||||
m_fileName = LoadObject(stream, mod).cast<PycString>();
|
||||
m_name = LoadObject(stream, mod).cast<PycString>();
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue