Fix display of cell vars
This commit is contained in:
@@ -358,8 +358,7 @@ void bc_disasm(PycRef<PycCode> code, PycModule* mod, int indent)
|
||||
} else if (Pyc::IsVarNameArg(opcode)) {
|
||||
fprintf(pyc_output, "%d: %s", operand, code->getVarName(operand)->value());
|
||||
} else if (Pyc::IsCellArg(opcode)) {
|
||||
fprintf(pyc_output, "%d: ", operand);
|
||||
print_const(code->getCellVar(operand), mod);
|
||||
fprintf(pyc_output, "%d: %s", operand, code->getCellVar(operand)->value());
|
||||
} else if (Pyc::IsJumpOffsetArg(opcode)) {
|
||||
fprintf(pyc_output, "%d (to %d)", operand, pos+operand);
|
||||
} else if (Pyc::IsCompareArg(opcode)) {
|
||||
|
@@ -58,10 +58,11 @@ public:
|
||||
PycRef<PycString> getVarName(int idx) const
|
||||
{ return m_varNames->get(idx).cast<PycString>(); }
|
||||
|
||||
PycRef<PycObject> getCellVar(int idx) const
|
||||
PycRef<PycString> getCellVar(int idx) const
|
||||
{
|
||||
return (idx >= m_cellVars->size()) ? m_freeVars->get(idx - m_cellVars->size())
|
||||
: m_cellVars->get(idx);
|
||||
return (idx >= m_cellVars->size())
|
||||
? m_freeVars->get(idx - m_cellVars->size()).cast<PycString>()
|
||||
: m_cellVars->get(idx).cast<PycString>();
|
||||
}
|
||||
|
||||
const globals_t& getGlobals() const { return m_globalsUsed; }
|
||||
|
Reference in New Issue
Block a user