8000 GH-100982: Add `COMPARE_AND_BRANCH` instruction by markshannon · Pull Request #100983 · python/cpython · GitHub
[go: up one dir, main page]

Skip to content

GH-100982: Add COMPARE_AND_BRANCH instruction #100983

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Prev Previous commit
Next Next commit
Avoid unused variable warning when NDEBUG is defined.
  • Loading branch information
markshannon committed Jan 16, 2023
commit 776ba5475652c7dee9b0a2acd06dc833675106b4
2 changes: 2 additions & 0 deletions Python/specialize.c
Original file line number Diff line number Diff line change
Expand Up @@ -2005,8 +2005,10 @@ _Py_Specialize_CompareAndBranch(PyObject *lhs, PyObject *rhs, _Py_CODEUNIT *inst
{
assert(_PyOpcode_Caches[COMPARE_AND_BRANCH] == INLINE_CACHE_ENTRIES_COMPARE_OP);
_PyCompareOpCache *cache = (_PyCompareOpCache *)(instr + 1);
#ifndef NDEBUG
int next_opcode = _Py_OPCODE(instr[INLINE_CACHE_ENTRIES_COMPARE_OP + 1]);
assert(next_opcode == POP_JUMP_IF_FALSE || next_opcode == POP_JUMP_IF_TRUE);
#endif
if (Py_TYPE(lhs) != Py_TYPE(rhs)) {
SPECIALIZATION_FAIL(COMPARE_AND_BRANCH, compare_op_fail_kind(lhs, rhs));
goto failure;
Expand Down
0