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

Expansion of printk in dprintk in TrailingConditionalVariadicMacro test case cause if (debug) to disappear. #533

Open
pgoodman opened this issue Apr 11, 2024 · 3 comments
Assignees
Labels
api bug Something isn't working

Comments

@pgoodman
Copy link
Contributor

image

Then after expanding printk:

image

@pgoodman pgoodman added bug Something isn't working api labels Apr 11, 2024
@pgoodman pgoodman self-assigned this Apr 11, 2024
@pgoodman
Copy link
Contributor Author

We can see the issue here:
image

The macro name printk ends up on the right-hand side of an after expansion, lead by if (debug), but this all exists on the before side of another expansion. This is now triggering an assertion in the indexer.

@pgoodman
Copy link
Contributor Author

This is a simpler, albeit eviler test case:

#define Y 1
#define X Y
#define A if (1) B
#define B(a) return C
#define C(a) a

int main() {
  A(Y)(X);
  return 0;
}

@pgoodman
Copy link
Contributor Author

Not yet fixed, this is what the token tree looks like:
image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant