8000 Typo in `_GUARD_BOTH_UNICODE` dsl · Issue #130903 · python/cpython · GitHub
[go: up one dir, main page]

Skip to content
Typo in _GUARD_BOTH_UNICODE dsl #130903
Closed
Closed
@ordinary-jamie

Description

@ordinary-jamie

Bug report

Bug description:

There appears to be a typo in the optimizer_bytecodes for _GUARD_BOTH_UNICODE where the right operand is not getting checked:

op(_GUARD_BOTH_UNICODE, (left, right -- left, right)) {
if (sym_matches_type(left, &PyUnicode_Type) &&
sym_matches_type(right, &PyUnicode_Type)) {
REPLACE_OP(this_instr, _NOP, 0 ,0);
}
sym_set_type(left, &PyUnicode_Type);
sym_set_type(left, &PyUnicode_Type);

Original change from gh-118910:

https://github.com/python/cpython/pull/118913/files#diff-e5bd2b14b0b10f0f47786e26306d689ed1361c3dc3b11dcc3ea52b8a2422ff64L151-R141

N.b. I'm not very familiar with this part of the code-base and just happened to stumble upon this when studying through it; apologies if I misunderstood something 🙏

CPython versions tested on:

3.14, CPython main branch

Operating systems tested on:

No response

Linked PRs

Metadata

Metadata

Assignees

No one assigned

    Labels

    type-bugAn unexpected behavior, bug, or error

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0