summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJosé Fonseca <jfonseca@vmware.com>2010-05-15 09:43:16 +0100
committerJosé Fonseca <jfonseca@vmware.com>2010-05-15 09:43:16 +0100
commite31164091ccc9cc8cdeec5b49430e672880319c1 (patch)
tree25597805e5712a8c047897aece5cafe0927d4635
parentaf75bb4c9865a8162ae190d99d062047150b67b5 (diff)
gallivm: Ensure all masks are initialized.
Or calls from outermost scope cause NULL ptr derreference.
-rw-r--r--src/gallium/auxiliary/gallivm/lp_bld_tgsi_soa.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/src/gallium/auxiliary/gallivm/lp_bld_tgsi_soa.c b/src/gallium/auxiliary/gallivm/lp_bld_tgsi_soa.c
index 6e1e41fdee..c658c40cf7 100644
--- a/src/gallium/auxiliary/gallivm/lp_bld_tgsi_soa.c
+++ b/src/gallium/auxiliary/gallivm/lp_bld_tgsi_soa.c
@@ -332,6 +332,8 @@ static LLVMValueRef lp_get_function(struct lp_build_tgsi_soa_context *bld,
static void lp_exec_mask_init(struct lp_exec_mask *mask, struct lp_build_context *bld)
{
+ LLVMValueRef ones;
+
mask->bld = bld;
mask->has_mask = FALSE;
mask->cond_stack_size = 0;
@@ -339,8 +341,12 @@ static void lp_exec_mask_init(struct lp_exec_mask *mask, struct lp_build_context
mask->ret_mask = 0;
mask->int_vec_type = lp_build_int_vec_type(mask->bld->type);
- mask->break_mask = mask->cont_mask = mask->cond_mask =
- LLVMConstAllOnes(mask->int_vec_type);
+ ones = LLVMConstAllOnes(mask->int_vec_type);
+ mask->cond_mask = ones;
+ mask->cont_mask = ones;
+ mask->break_mask = ones;
+ mask->ret_mask = ones;
+ mask->exec_mask = ones;
}
static void lp_exec_mask_update(struct lp_exec_mask *mask)