Throw away? Hopefully that means replace it with a crash? If it's just carrying on, that sounds bad.
Why? If you are an experienced C or C++ programmer you know about these quirks. Replacing an infinite loop without side effects with a crash sounds about as "bad" as optimizing it away.