COMPARE_OP operand changes in 3.12

This commit is contained in:
Nenad Čaklović
2024-01-04 23:42:54 +01:00
parent 7560149895
commit 830dd13228
2 changed files with 13 additions and 5 deletions

View File

@@ -638,7 +638,10 @@ PycRef<ASTNode> BuildFromCode(PycRef<PycCode> code, PycModule* mod)
stack.pop();
PycRef<ASTNode> left = stack.top();
stack.pop();
stack.push(new ASTCompare(left, right, operand));
auto arg = operand;
if (mod->verCompare(3, 12) >= 0)
arg >>= 4; // changed under GH-100923
stack.push(new ASTCompare(left, right, arg));
}
break;
case Pyc::CONTAINS_OP_A: