Skip to content
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

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

Closed
markshannon opened this issue Jul 23, 2024 · 0 comments
Labels
3.13 bugs and security fixes 3.14 new features, bugs and security fixes type-bug An unexpected behavior, bug, or error

Comments

@markshannon
Copy link
Member

markshannon commented Jul 23, 2024

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

@markshannon markshannon added type-bug An unexpected behavior, bug, or error 3.13 bugs and security fixes 3.14 new features, bugs and security fixes labels Jul 23, 2024
markshannon added a commit to faster-cpython/cpython that referenced this issue Jul 23, 2024
nohlson pushed a commit to nohlson/cpython that referenced this issue Jul 24, 2024
nohlson pushed a commit to nohlson/cpython that referenced this issue Jul 24, 2024
blhsing pushed a commit to blhsing/cpython that referenced this issue Aug 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
3.13 bugs and security fixes 3.14 new features, bugs and security fixes type-bug An unexpected behavior, bug, or error
Projects
None yet
Development

No branches or pull requests

1 participant