Skip to content

bpo-44060: Enable TARGET labels even when not using computed gotos. #25949

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

Closed
wants to merge 3 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
The TARGET_#op label is now available even when computed gotos aren't
enabled.
8 changes: 6 additions & 2 deletions Python/ceval.c
Original file line number Diff line number Diff line change
Expand Up @@ -1296,11 +1296,15 @@ eval_frame_handle_pending(PyThreadState *tstate)
#define USE_COMPUTED_GOTOS 0
#endif

#if USE_COMPUTED_GOTOS
#if USE_COMPUTED_GOTOS || defined(Py_DEBUG)
#define TARGET(op) op: TARGET_##op
#define DISPATCH_GOTO() goto *opcode_targets[opcode]
#else
#define TARGET(op) op
#endif

#if USE_COMPUTED_GOTOS
#define DISPATCH_GOTO() goto *opcode_targets[opcode]
#else
#define DISPATCH_GOTO() goto dispatch_opcode
#endif

Expand Down