Skip to content

Unreachable code warning in specialize.c #94021

Description

@tiran

Bug report

Some versions of clang complain about unreachable code in specialize.c

cpython/Python/specialize.c

Lines 1911 to 1920 in 774ef28

#ifndef Py_STATS
_Py_SET_OPCODE(*instr, COMPARE_OP);
return;
#endif
if (next_opcode == EXTENDED_ARG) {
SPECIALIZATION_FAIL(COMPARE_OP, SPEC_FAIL_COMPARE_OP_EXTENDED_ARG);
goto failure;
}
SPECIALIZATION_FAIL(COMPARE_OP, SPEC_FAIL_COMPARE_OP_NOT_FOLLOWED_BY_COND_JUMP);
goto failure;

Python/specialize.c:1915:13: warning: code will never be executed [-Wunreachable-code]

The problem is trivial to fix.

Activity

  1. added
    type-bugAn unexpected behavior, bug, or error
    3.11only security fixes
    3.12only security fixes
    on Jun 20, 2022
  2. added a commit that references this issue on Jun 20, 2022
  3. added 3 commits that reference this issue on Jun 21, 2022
  4. kumaraditya303 commented on Jun 23, 2022

    @kumaraditya303
    Contributor

    Fixed by #94022

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

3.11only security fixes3.12only security fixestype-bugAn unexpected behavior, bug, or error

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions