projects
/
mesa.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
99e822f
)
mesa: Add an assertion to _mesa_program_index_to_target().
author
Paul Berry
<stereotype441@gmail.com>
Tue, 17 Dec 2013 18:11:27 +0000
(10:11 -0800)
committer
Paul Berry
<stereotype441@gmail.com>
Mon, 30 Dec 2013 19:21:33 +0000
(11:21 -0800)
Only a Mesa bug could cause this function to be called with an
out-of-range index, so raise an assertion if that ever happens.
Reviewed-by: Brian Paul <brianp@vmware.com>
src/mesa/program/program.h
patch
|
blob
|
history
diff --git
a/src/mesa/program/program.h
b/src/mesa/program/program.h
index 135271caf9a3206f045f9f43a9548bd9faf61468..baff473764d9f04594874d8c88ec8485531fc2d7 100644
(file)
--- a/
src/mesa/program/program.h
+++ b/
src/mesa/program/program.h
@@
-216,9
+216,10
@@
_mesa_program_index_to_target(GLuint i)
GL_FRAGMENT_PROGRAM_ARB
};
STATIC_ASSERT(Elements(enums) == MESA_SHADER_TYPES);
- if(i >= MESA_SHADER_TYPES)
+ if(i >= MESA_SHADER_TYPES) {
+ assert(!"Unexpected program index");
return 0;
- else
+
}
else
return enums[i];
}