GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Cases generator gets confused about the number of values to pop in case of errors in some macros · Issue #122155 · python/cpython

Cases generator gets confused about the number of values to pop in case of errors in some macros #122155

New issue
Copy link
New issue
Copy link
Closed
Closed
Cases generator gets confused about the number of values to pop in case of errors in some macros#122155
Copy link
Labels
3.13only security fixesonly security fixes3.14bugs and security fixesbugs and security fixestype-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error

Description

@markshannon
markshannon
opened on Jul 23, 2024
Issue body actions

Bug report

Bug description:

This input:

        op(FIRST, (x, y -- a, b)) {
            a = x;
            b = y;
        }

        op(SECOND, (a, b -- a, b)) {
        }

        op(THIRD, (j, k --)) {
            ERROR_IF(cond, error);
        }

        macro(TEST) = FIRST + SECOND + THIRD;
        """

Generates:

     ...
     if (cond) goto pop_4_error;
     ...

This should be if (cond) goto pop_2_error;

I noticed this error when working on a fix to #122029, so this isn't just a theoretical bug.

CPython versions tested on:

CPython main branch

Operating systems tested on:

No response

Linked PRs

  • GH-122155: Fix cases generator to correctly compute 'peek' offset for error handling #122158
  • [3.13] GH-122155: Fix cases generator to correctly compute 'peek' offset for error handling (GH-122158) #122174
  • GH-122155: Track local variables between pops and pushes in cases generator #122286

Activity

  1. markshannon
    added
    type-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error
    3.13only security fixesonly security fixes
    3.14bugs and security fixesbugs and security fixes
    on Jul 23, 2024
  2. markshannon
    added 2 commits that reference this issue on Jul 23, 2024

    GH-122155: Fix cases generator to correctly compute 'peek' offset for…

    624bda7

    pythonGH-122155: Fix cases generator to correctly compute 'peek' offs…

    8a7484b
  3. nohlson
    added 2 commits that reference this issue on Jul 24, 2024

    pythonGH-122155: Fix cases generator to correctly compute 'peek' offs…

    364eb6c

    pythonGH-122155: Fix cases generator to correctly compute 'peek' offs…

    3d74e5b
  4. markshannon
    added 2 commits that reference this issue on Jul 26, 2024

    [3.13] GH-122155: Fix cases generator to correctly compute 'peek' off…

    9162da2

    GH-122155: Track local variables between pops and pushes in cases gen…

    a9d56e3
  5. markshannon
    closed this as completedon Aug 12, 2024
  6. blhsing
    added a commit that references this issue on Aug 22, 2024

    pythonGH-122155: Track local variables between pops and pushes in cas…

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    3.13only security fixesonly security fixes3.14bugs and security fixesbugs and security fixestype-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

      You are visitor 01402503 — GeezerVison does not store the pages you look up.
      Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.