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

Rewrite const expr used as template arguments #332

Merged
merged 7 commits into from
Sep 16, 2024
Merged

Conversation

JonathanFoo0523
Copy link
Collaborator

Prevents an issue where constant expressions used in template arguments
could have their initializers altered, causing the template argument to
no longer be a compile-time constant. We rewrite the template argument
expressions to substitute them with their evaluated values. This allows
the constants within the template argument expressions — potentially
referenced elsewhere — to have their initial values modified freely.

Fixes #331 .

Copy link
Member

@afd afd left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks good to me - thanks. Please see a couple of small changes to attend to in my review, but otherwise good to merge.

src/libdredd/src/mutate_visitor.cc Outdated Show resolved Hide resolved
@JonathanFoo0523 JonathanFoo0523 merged commit cac9217 into main Sep 16, 2024
9 checks passed
@JonathanFoo0523 JonathanFoo0523 deleted the issue-331 branch September 16, 2024 16:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

dredd mutates constant expression used as template argument
2 participants