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 zero size array handling in slangc #6399

Merged
merged 6 commits into from
Feb 19, 2025

Conversation

mkeshavaNV
Copy link
Contributor

Fixes #2890

  1. Fix zero size array handling in slangc
  2. Add new zero size array diagnostic test.

Fixes shader-slang#2890

1. Fix zero size array handling in slangc
2. Add new zero size array diagnostic test.
@mkeshavaNV mkeshavaNV added the pr: non-breaking PRs without breaking changes label Feb 19, 2025
@mkeshavaNV
Copy link
Contributor Author

/format

@slangbot
Copy link
Contributor

🌈 Formatted, please merge the changes from this PR

@mkeshavaNV
Copy link
Contributor Author

@expipiplus1 @jkwak-work for Cc.
This adds the correct test and actually addresses #2890

@mkeshavaNV mkeshavaNV marked this pull request as ready for review February 19, 2025 08:03
@mkeshavaNV mkeshavaNV requested a review from a team as a code owner February 19, 2025 08:03
csyonghe
csyonghe previously approved these changes Feb 19, 2025
@@ -2,12 +2,12 @@

// Test that array size cannot be zero

//TEST:SIMPLE:
//DIAGNOSTIC_TEST:SIMPLE:
Copy link
Collaborator

Choose a reason for hiding this comment

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

For new tests, we use filecheck instead of a separate expected result file.

Here, you write:

//DIAGNOSTIC_TEST:SIMPLE(filecheck=CHECK):

Copy link
Contributor Author

Choose a reason for hiding this comment

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

thanks, updated.

func bar() -> int[0];
Copy link
Collaborator

Choose a reason for hiding this comment

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

Before this line, you can write:

//CHECK: ([[# @LINE+1]]): error 30025

To match for (13): error 30025 in the output.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

thanks, updated.

@expipiplus1 expipiplus1 enabled auto-merge (squash) February 19, 2025 10:56
@expipiplus1 expipiplus1 merged commit 12d09b5 into shader-slang:master Feb 19, 2025
16 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
pr: non-breaking PRs without breaking changes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

assertion failure with zero-length array
4 participants