python / python/cpython

Superfluous dialect symbol in inline assembly

Open
#157,250 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

interpreter-core type-bug
Dominant language
Python
Stars
77.2k
Forks
35.9k
PR merge metrics
PR metrics pending

Description

Bug report

Bug description:

This inline assembly block has an extra { at the start that is likely a typo:
https://github.com/python/cpython/blob/f715d25a8f0f0d57ecd2ae0dfe56c2ee01752733/Include/internal/pycore_pystate.h#L327

In GCC style inline assembly syntax, { initiates an dialect selector block [1] and this case forms an unfinished section of that.
It being silently accepted by current GCC/Clang is likely just them being permissive.

[1] https://gcc.gnu.org/onlinedocs/gcc/Extended-Asm.html#Multiple-assembler-dialects-in-asm-templates

CPython versions tested on:

CPython main branch

Operating systems tested on:

Linux

Linked PRs
  • gh-157251

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Inspect Include/internal/pycore_pystate.h at line 327 and compare the inline assembly syntax with GCC's multiple-dialect documentation. Confirm the intended correction against GCC and Clang on Linux, with the work complete when the assembly no longer contains the unfinished dialect selector and relevant CPython checks pass.

Written by the indexing model from the issue text.

Assessment

Tech stack
c
Domain
compilers
Issue type
Bug
Difficulty
1/5
Estimated time
Under an hour
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.