Giovanni Mascellani (@giomasce) commented about libs/vkd3d-shader/dxil.c:
+{
- unsigned int l, prev_len = 0;
- uint32_t bits;
- if (!length)
return 0;
- if (shader_sm6_is_end(parser))
- {
parser->failed = true;
return 0;
- }
- bits = *parser->ptr >> parser->bitpos;
- l = 32 - parser->bitpos;
- /* The result of uint32 >> 32 is undefined, so bitpos must be <= 31 */
I would convert this to an assertion. It gives the same information, but can be checked by the compiler.