projects
/
mesa.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
70f5887
)
spirv: Require a storage type for OpStore destinations
author
Jason Ekstrand
<jason.ekstrand@intel.com>
Wed, 3 Jan 2018 17:05:31 +0000
(09:05 -0800)
committer
Jason Ekstrand
<jason.ekstrand@intel.com>
Mon, 8 Jan 2018 22:57:44 +0000
(14:57 -0800)
This rules out things such as trying to store a pointer to a local
variable.
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
src/compiler/spirv/vtn_variables.c
patch
|
blob
|
history
diff --git
a/src/compiler/spirv/vtn_variables.c
b/src/compiler/spirv/vtn_variables.c
index 2b3b3405e4de8c0d77ffb88496729b4a8517b355..399860b8085e5a143746b9b5c736f19cf316cc9e 100644
(file)
--- a/
src/compiler/spirv/vtn_variables.c
+++ b/
src/compiler/spirv/vtn_variables.c
@@
-2009,6
+2009,10
@@
vtn_handle_variables(struct vtn_builder *b, SpvOp opcode,
struct vtn_pointer *dest = dest_val->pointer;
struct vtn_value *src_val = vtn_untyped_value(b, w[2]);
+ /* OpStore requires us to actually have a storage type */
+ vtn_fail_if(dest->type->type == NULL,
+ "Invalid destination type for OpStore");
+
vtn_fail_if(dest_val->type->deref != src_val->type,
"Value and pointer types of OpStore do not match");