mirror of
https://github.com/encounter/dawn-cmake.git
synced 2025-12-11 22:44:04 +00:00
Validate that runtime arrays aren't used as parameters
Remove the logic around `arrayLength()` being passed anything but a member accessor. Runtime arrays types cannot be used for variables nor parameters. Add validator logic and test for runtime array parameters. Adjust the validator error message so it doesn't include the field / variable name. This read weird, and the same information is already provided by the source. Bug: tint:266 Bug: tint:252 Change-Id: Iecedb0524e10a67b4f8ad15635d67fe61e9d69d9 Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/36420 Auto-Submit: Ben Clayton <bclayton@google.com> Commit-Queue: dan sinclair <dsinclair@chromium.org> Reviewed-by: dan sinclair <dsinclair@chromium.org>
This commit is contained in:
committed by
Commit Bot service account
parent
938ff5f482
commit
ca2c1ed370
@@ -83,6 +83,10 @@ class ValidatorImpl {
|
||||
/// @param func the function to check
|
||||
/// @returns true if the validation was successful
|
||||
bool ValidateFunction(const ast::Function* func);
|
||||
/// Validates a function parameter
|
||||
/// @param param the function parameter to check
|
||||
/// @returns true if the validation was successful
|
||||
bool ValidateParameter(const ast::Variable* param);
|
||||
/// Validates a block of statements
|
||||
/// @param block the statements to check
|
||||
/// @returns true if the validation was successful
|
||||
|
||||
Reference in New Issue
Block a user