summaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/nv50
diff options
context:
space:
mode:
authorBrian Paul <[email protected]>2012-02-01 08:20:05 -0700
committerBrian Paul <[email protected]>2012-02-01 08:22:16 -0700
commitf09910f399d747e524731953bb11b64c1f4821d0 (patch)
tree7212b342d3f2a0ae4a5c21acdf00c073f7361bd9 /src/gallium/drivers/nv50
parent0d736b2076e61c4db1399b55e7bed898ad6d360d (diff)
nv50: add assertions missed in earlier nv50 commit
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)