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

fix(const_eval): don't panic when a vecN constructor's arg. count is less than N #6508

Merged

Conversation

ErichDonGubler
Copy link
Member

@ErichDonGubler ErichDonGubler commented Nov 8, 2024

Connections

Description

From my comment in the issue:

component_wise_* functions in the const_eval module presume that a Compose expression of a Vector of N elements (in the OP example, vec4) has N arguments in the IR.

Stop presuming this, and return an error gracefully if the condition is violated.

Testing

Tested manually.

Checklist

  • Run cargo fmt.
  • Run taplo format.
  • Run cargo clippy. If applicable, add:
    • --target wasm32-unknown-unknown
    • --target wasm32-unknown-emscripten
  • Run cargo xtask test to run tests.
  • Add change to CHANGELOG.md. See simple instructions inside file.

@ErichDonGubler ErichDonGubler added the type: bug Something isn't working label Nov 8, 2024
@ErichDonGubler ErichDonGubler self-assigned this Nov 8, 2024
@ErichDonGubler ErichDonGubler requested a review from a team November 8, 2024 23:38
@ErichDonGubler ErichDonGubler changed the title fix(const_eval): don't panic when vecN ctor.'s arg. count is < N fix(const_eval): don't panic when a vecN constructor's arg. count is less than N Nov 9, 2024
Copy link
Member

@teoxoy teoxoy left a comment

Choose a reason for hiding this comment

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

Nice!

@ErichDonGubler ErichDonGubler enabled auto-merge (squash) November 12, 2024 12:19
@ErichDonGubler ErichDonGubler merged commit 5e68a63 into gfx-rs:trunk Nov 12, 2024
27 checks passed
@ErichDonGubler ErichDonGubler deleted the n-gt-vecn-args-kalm branch November 12, 2024 12:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: bug Something isn't working
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

2 participants