If the runtime can detect undefined behavior, why do something random?  Just report the undefined behavior to the user.  Now you have UBSan: <a href="https:&#x2F;&#x2F;www.chromium.org&#x2F;developers&#x2F;testing&#x2F;undefinedbehaviorsanitizer" rel="nofollow">https:&#x2F;&#x2F;www.chromium.org&#x2F;developers&#x2F;testing&#x2F;undefinedbehavio...</a>