Fix LOAD_GLOBAL and cell var references in Python 3.11+
This commit is contained in:
@@ -1606,7 +1606,7 @@ PycRef<ASTNode> BuildFromCode(PycRef<PycCode> code, PycModule* mod)
|
||||
}
|
||||
break;
|
||||
case Pyc::LOAD_DEREF_A:
|
||||
stack.push(new ASTName(code->getCellVar(operand)));
|
||||
stack.push(new ASTName(code->getCellVar(mod, operand)));
|
||||
break;
|
||||
case Pyc::LOAD_FAST_A:
|
||||
if (mod->verCompare(1, 3) < 0)
|
||||
@@ -2100,7 +2100,7 @@ PycRef<ASTNode> BuildFromCode(PycRef<PycCode> code, PycModule* mod)
|
||||
case Pyc::STORE_DEREF_A:
|
||||
{
|
||||
if (unpack) {
|
||||
PycRef<ASTNode> name = new ASTName(code->getCellVar(operand));
|
||||
PycRef<ASTNode> name = new ASTName(code->getCellVar(mod, operand));
|
||||
|
||||
PycRef<ASTNode> tup = stack.top();
|
||||
if (tup.type() == ASTNode::NODE_TUPLE)
|
||||
@@ -2122,7 +2122,7 @@ PycRef<ASTNode> BuildFromCode(PycRef<PycCode> code, PycModule* mod)
|
||||
} else {
|
||||
PycRef<ASTNode> value = stack.top();
|
||||
stack.pop();
|
||||
PycRef<ASTNode> name = new ASTName(code->getCellVar(operand));
|
||||
PycRef<ASTNode> name = new ASTName(code->getCellVar(mod, operand));
|
||||
|
||||
if (value.type() == ASTNode::NODE_CHAINSTORE) {
|
||||
append_to_chain_store(value, name, stack, curblock);
|
||||
|
Reference in New Issue
Block a user