diff --git a/bytecode.cpp b/bytecode.cpp index ba5b833..462e4e5 100644 --- a/bytecode.cpp +++ b/bytecode.cpp @@ -358,8 +358,7 @@ void bc_disasm(PycRef 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)) { diff --git a/pyc_code.h b/pyc_code.h index 8a57869..a2c7afb 100644 --- a/pyc_code.h +++ b/pyc_code.h @@ -58,10 +58,11 @@ public: PycRef getVarName(int idx) const { return m_varNames->get(idx).cast(); } - PycRef getCellVar(int idx) const + PycRef 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() + : m_cellVars->get(idx).cast(); } const globals_t& getGlobals() const { return m_globalsUsed; }