summaryrefslogtreecommitdiff
path: root/src/mesa/shader/slang/slang_compile_operation.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/mesa/shader/slang/slang_compile_operation.c')
-rw-r--r--src/mesa/shader/slang/slang_compile_operation.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/mesa/shader/slang/slang_compile_operation.c b/src/mesa/shader/slang/slang_compile_operation.c
index aa66be8895..cf82080066 100644
--- a/src/mesa/shader/slang/slang_compile_operation.c
+++ b/src/mesa/shader/slang/slang_compile_operation.c
@@ -42,6 +42,7 @@ slang_operation_construct(slang_operation * oper)
oper->children = NULL;
oper->num_children = 0;
oper->literal[0] = 0.0;
+ oper->literal_size = 1;
oper->a_id = SLANG_ATOM_NULL;
oper->locals = _slang_variable_scope_new(NULL);
if (oper->locals == NULL)
@@ -104,6 +105,8 @@ slang_operation_copy(slang_operation * x, const slang_operation * y)
z.literal[2] = y->literal[2];
z.literal[3] = y->literal[3];
z.literal_size = y->literal_size;
+ assert(y->literal_size >= 1);
+ assert(y->literal_size <= 4);
z.a_id = y->a_id;
if (y->locals) {
if (!slang_variable_scope_copy(z.locals, y->locals)) {