On Fri Nov 11 01:09:52 2022 +0000, Zebediah Figura wrote:
Maybe, but the invariant here is "an hlsl_block resulting from an expression should never have one of these as the last instruction, because none of them have a value", which feels more like "invariant that could be violated by accident" than "invariant that can only be violated due to memory corruption". Granted, I think Henri has argued that the former should be ERR() and the latter unreachable(), i.e. there's no room for assert() anywhere...
I don't see a real difference between violating an invariant by accident or by cosmic ray. To me any program configuration either can be reached for some user input (which is legitimate, i.e., not considered to cause undefined behavior) or it can't. In the first case an error message must be outputted, in the second case an assertion must be triggered (and `vkd3d_unreachable()` is just a better `assert(0)`).
Just my two cents, though.