|
|
|
|
|
by repsilat
5518 days ago
|
|
> it's better to crash hard and fast I'm not so sure about that. If you need to squeeze out a little more performance, code that is "technically undefined" can be more portable than dropping to ASM. I think LLVM should emit a warning on code with undefined semantics and generate DWIM instructions instead of UD2s. |
|
But you're correct that sometimes it can be expedient to exploit such technically undefined behavior. (I've committed this sin myself, most commonly in serializers/deserializers)