mirror of
https://github.com/storytold/wgpu.git
synced 2026-11-24 08:21:25 +01:00
validate: check global var type to be in range
This commit is contained in:
1 parent
a4ea9ce68d
commit
c9f52bd651
1 file changed
+4
-1
@@ -332,7 +332,10 @@ impl super::Validator {
|
||||
use super::TypeFlags;
|
||||
|
||||
log::debug!("var {:?}", var);
|
||||
let type_info = &self.types[var.ty.index()];
|
||||
let type_info = self
|
||||
.types
|
||||
.get(var.ty.index())
|
||||
.ok_or(GlobalVariableError::InvalidType)?;
|
||||
|
||||
let (required_type_flags, is_resource) = match var.class {
|
||||
crate::StorageClass::Function => return Err(GlobalVariableError::InvalidUsage),
|
||||
|
||||
Reference in new issue
Block a user