aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorAnuj Phogat <[email protected]>2013-06-27 16:12:07 -0700
committerAnuj Phogat <[email protected]>2013-06-28 10:53:43 -0700
commitee723ffabb4c76f4c1924436af145f5eca1012fc (patch)
tree4c4aaec619542401666770d021d093f9d43c81ce /src
parentbee49cb0ecbacb9fbc9dddc5e560874adacc518e (diff)
mesa: Return ZeroVec/dummyReg instead of NULL pointer
Assertions are not sufficient to check for null pointers as they don't show up in release builds. So, return ZeroVec/dummyReg instead of NULL pointer in get_{src,dst}_register_pointer(). This should calm down the warnings from static analysis tool. Note: This is a candidate for the 9.1 branch. Signed-off-by: Anuj Phogat <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]> Reviewed-by: Brian Paul <[email protected]>
Diffstat (limited to 'src')
-rw-r--r--src/mesa/program/prog_execute.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/src/mesa/program/prog_execute.c b/src/mesa/program/prog_execute.c
index b902006ef5b..560332a6e63 100644
--- a/src/mesa/program/prog_execute.c
+++ b/src/mesa/program/prog_execute.c
@@ -145,7 +145,7 @@ get_src_register_pointer(const struct prog_src_register *source,
_mesa_problem(NULL,
"Invalid src register file %d in get_src_register_pointer()",
source->File);
- return NULL;
+ return ZeroVec;
}
}
@@ -184,7 +184,7 @@ get_dst_register_pointer(const struct prog_dst_register *dest,
_mesa_problem(NULL,
"Invalid dest register file %d in get_dst_register_pointer()",
dest->File);
- return NULL;
+ return dummyReg;
}
}
@@ -199,7 +199,6 @@ fetch_vector4(const struct prog_src_register *source,
const struct gl_program_machine *machine, GLfloat result[4])
{
const GLfloat *src = get_src_register_pointer(source, machine);
- ASSERT(src);
if (source->Swizzle == SWIZZLE_NOOP) {
/* no swizzling */
@@ -302,7 +301,6 @@ fetch_vector1(const struct prog_src_register *source,
const struct gl_program_machine *machine, GLfloat result[4])
{
const GLfloat *src = get_src_register_pointer(source, machine);
- ASSERT(src);
result[0] = src[GET_SWZ(source->Swizzle, 0)];