diff options
author | Paul Berry <[email protected]> | 2013-12-17 10:11:27 -0800 |
---|---|---|
committer | Paul Berry <[email protected]> | 2013-12-30 11:21:33 -0800 |
commit | 7e0b4b5e9b719de9f01e808fc18138b67be4178a (patch) | |
tree | e41c8f8e582ff35fab5c3c4fc99be2017bc1f45b /src/mesa/program | |
parent | 99e822fa18a322f7bf0d32ce99eab534d5614469 (diff) |
mesa: Add an assertion to _mesa_program_index_to_target().
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 <[email protected]>
Diffstat (limited to 'src/mesa/program')
-rw-r--r-- | src/mesa/program/program.h | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/mesa/program/program.h b/src/mesa/program/program.h index 135271caf9a..baff473764d 100644 --- 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]; } |