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

threads: add validation for constant expressions #1898

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

abrown
Copy link
Collaborator

@abrown abrown commented Nov 7, 2024

Previously, it was possible to use an unshared global to initialize a shared global, table element. This change makes that invalid by propagating sharedness in to the constant expression validator.

if let Some(id) = unpacked_index.as_core_type_id() {
types[id].composite_type.shared
} else {
todo!()
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Not sure what to do here — is this actually unreachable?

Copy link
Member

Choose a reason for hiding this comment

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

I think so yeah, but I think this can also use the types.reftype_is_shared(ty) helper?

Previously, it was possible to use an unshared global to initialize a
shared global, table element. This change makes that invalid by
propagating sharedness in to the constant expression validator.
@abrown abrown force-pushed the set-const-expr-validation branch from 325d71f to d99b51d Compare November 7, 2024 23:13
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.

2 participants