summaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/nv50
diff options
context:
space:
mode:
Diffstat (limited to 'src/gallium/drivers/nv50')
-rw-r--r--src/gallium/drivers/nv50/codegen/nv50_ir_peephole.cpp1
-rw-r--r--src/gallium/drivers/nv50/nv50_pc_regalloc.c1
2 files changed, 2 insertions, 0 deletions
diff --git a/src/gallium/drivers/nv50/codegen/nv50_ir_peephole.cpp b/src/gallium/drivers/nv50/codegen/nv50_ir_peephole.cpp
index fb4041f0b88..43d6b21a3f6 100644
--- a/src/gallium/drivers/nv50/codegen/nv50_ir_peephole.cpp
+++ b/src/gallium/drivers/nv50/codegen/nv50_ir_peephole.cpp
@@ -1478,6 +1478,7 @@ MemoryOpt::replaceStFromSt(Instruction *restrict st, Record *rec)
// get non-replaced sources after values covered by st
for (; offR < endR; offR += ri->getSrc(s)->reg.size, ++s)
vals[k++] = ri->getSrc(s);
+ assert(k <= Elements(vals));
for (s = 0; s < k; ++s)
st->setSrc(s + 1, vals[s]);
st->setSrc(0, ri->getSrc(0));
diff --git a/src/gallium/drivers/nv50/nv50_pc_regalloc.c b/src/gallium/drivers/nv50/nv50_pc_regalloc.c
index e79fd594cea..72922cb0388 100644
--- a/src/gallium/drivers/nv50/nv50_pc_regalloc.c
+++ b/src/gallium/drivers/nv50/nv50_pc_regalloc.c
@@ -421,6 +421,7 @@ phi_opnd_for_bb(struct nv_instruction *phi, struct nv_basic_block *b,
int i, j;
for (j = -1, i = 0; i < 6 && phi->src[i]; ++i) {
+ assert(i < Elements(phi->src[i]));
srci = phi->src[i];
/* if already replaced, check with original source first */
if (srci->flags & NV_REF_FLAG_REGALLOC_PRIV)