Mesa (master): gallivm: added some vector length sanity checks

Brian Paul brianp at kemper.freedesktop.org
Fri May 14 19:24:37 UTC 2010


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

Author: Brian Paul <brianp at vmware.com>
Date:   Fri May 14 13:23:10 2010 -0600

gallivm: added some vector length sanity checks

---

 src/gallium/auxiliary/gallivm/lp_bld_type.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/src/gallium/auxiliary/gallivm/lp_bld_type.c b/src/gallium/auxiliary/gallivm/lp_bld_type.c
index 70ac755..e6cd400 100644
--- a/src/gallium/auxiliary/gallivm/lp_bld_type.c
+++ b/src/gallium/auxiliary/gallivm/lp_bld_type.c
@@ -195,6 +195,7 @@ lp_uint_type(struct lp_type type)
 {
    struct lp_type res_type;
 
+   assert(type.length <= LP_MAX_VECTOR_LENGTH);
    memset(&res_type, 0, sizeof res_type);
    res_type.width = type.width;
    res_type.length = type.length;
@@ -211,6 +212,7 @@ lp_int_type(struct lp_type type)
 {
    struct lp_type res_type;
 
+   assert(type.length <= LP_MAX_VECTOR_LENGTH);
    memset(&res_type, 0, sizeof res_type);
    res_type.width = type.width;
    res_type.length = type.length;




More information about the mesa-commit mailing list