Mesa (master): glsl: fix off by one in register index assertion

Brian Paul brianp at kemper.freedesktop.org
Tue Nov 23 23:39:12 UTC 2010


Module: Mesa
Branch: master
Commit: 50fd99d1723a6c7f3bd2dedffeeadf7d5e33b83b
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=50fd99d1723a6c7f3bd2dedffeeadf7d5e33b83b

Author: Brian Paul <brianp at vmware.com>
Date:   Mon Nov 22 15:06:47 2010 -0700

glsl: fix off by one in register index assertion

---

 src/mesa/program/ir_to_mesa.cpp |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/src/mesa/program/ir_to_mesa.cpp b/src/mesa/program/ir_to_mesa.cpp
index 98da90d..4f263ad 100644
--- a/src/mesa/program/ir_to_mesa.cpp
+++ b/src/mesa/program/ir_to_mesa.cpp
@@ -2239,7 +2239,7 @@ mesa_src_reg_from_ir_src_reg(ir_to_mesa_src_reg reg)
    struct prog_src_register mesa_reg;
 
    mesa_reg.File = reg.file;
-   assert(reg.index < (1 << INST_INDEX_BITS) - 1);
+   assert(reg.index < (1 << INST_INDEX_BITS));
    mesa_reg.Index = reg.index;
    mesa_reg.Swizzle = reg.swizzle;
    mesa_reg.RelAddr = reg.reladdr != NULL;




More information about the mesa-commit mailing list