-
Notifications
You must be signed in to change notification settings - Fork 963
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
[naga] Forbid cycles between global expressions and types. #6800
[naga] Forbid cycles between global expressions and types. #6800
Conversation
Update `valid::handles` to traverse `Module::types` and `Module::global_expressions` in tandem, to ensure that the types and expressions are acyclic. Fixes gfx-rs#6793.
79d747d
to
75a5565
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The comments are spectacular. Would this also catch immediate self-reference of constants? like
const f: f32 = f;
or is it only type <-> expression cycles?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks great, left a question.
match size { | ||
crate::ArraySize::Pending(pending) => match pending { | ||
crate::PendingArraySize::Expression(expr) => Some(expr), | ||
crate::PendingArraySize::Override(_) => None, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shouldn't check the override initializer as well?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm, yes, we should.
Update
valid::handles
to traverseModule::types
andModule::global_expressions
in tandem, to ensure that the types andexpressions are acyclic.
Fixes #6793.