mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-06 18:08:40 +02:00
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 <anuj.phogat@gmail.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Brian Paul <brianp@vmware.com>
This commit is contained in:
parent
bee49cb0ec
commit
ee723ffabb
1 changed files with 2 additions and 4 deletions
|
|
@ -145,7 +145,7 @@ get_src_register_pointer(const struct prog_src_register *source,
|
||||||
_mesa_problem(NULL,
|
_mesa_problem(NULL,
|
||||||
"Invalid src register file %d in get_src_register_pointer()",
|
"Invalid src register file %d in get_src_register_pointer()",
|
||||||
source->File);
|
source->File);
|
||||||
return NULL;
|
return ZeroVec;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -184,7 +184,7 @@ get_dst_register_pointer(const struct prog_dst_register *dest,
|
||||||
_mesa_problem(NULL,
|
_mesa_problem(NULL,
|
||||||
"Invalid dest register file %d in get_dst_register_pointer()",
|
"Invalid dest register file %d in get_dst_register_pointer()",
|
||||||
dest->File);
|
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 struct gl_program_machine *machine, GLfloat result[4])
|
||||||
{
|
{
|
||||||
const GLfloat *src = get_src_register_pointer(source, machine);
|
const GLfloat *src = get_src_register_pointer(source, machine);
|
||||||
ASSERT(src);
|
|
||||||
|
|
||||||
if (source->Swizzle == SWIZZLE_NOOP) {
|
if (source->Swizzle == SWIZZLE_NOOP) {
|
||||||
/* no swizzling */
|
/* no swizzling */
|
||||||
|
|
@ -302,7 +301,6 @@ fetch_vector1(const struct prog_src_register *source,
|
||||||
const struct gl_program_machine *machine, GLfloat result[4])
|
const struct gl_program_machine *machine, GLfloat result[4])
|
||||||
{
|
{
|
||||||
const GLfloat *src = get_src_register_pointer(source, machine);
|
const GLfloat *src = get_src_register_pointer(source, machine);
|
||||||
ASSERT(src);
|
|
||||||
|
|
||||||
result[0] = src[GET_SWZ(source->Swizzle, 0)];
|
result[0] = src[GET_SWZ(source->Swizzle, 0)];
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue