mirror of
https://github.com/gfx-rs/wgpu.git
synced 2026-04-22 03:02:01 -04:00
validate: check function argument type to be in range
This commit is contained in:
@@ -837,7 +837,14 @@ impl super::Validator {
|
||||
|
||||
#[cfg(feature = "validate")]
|
||||
for (index, argument) in fun.arguments.iter().enumerate() {
|
||||
match module.types[argument.ty].inner.pointer_class() {
|
||||
let ty = module.types.get_handle(argument.ty).ok_or(
|
||||
FunctionError::InvalidArgumentType {
|
||||
index,
|
||||
name: argument.name.clone().unwrap_or_default(),
|
||||
}
|
||||
.with_span_handle(argument.ty, &module.types),
|
||||
)?;
|
||||
match ty.inner.pointer_class() {
|
||||
Some(crate::StorageClass::Private)
|
||||
| Some(crate::StorageClass::Function)
|
||||
| Some(crate::StorageClass::WorkGroup)
|
||||
|
||||
Reference in New Issue
Block a user