SNOAA91 may 2023 TLV1812 , TLV1851 , TLV7011
The LM339, LM393, LM290x and TL331 family can be considered one of the first "Fail-safe" inputs. These devices are fabricated on a very robust junction isolated bipolar process with PNP's with high reverse breakdowns.
In Figure 2-2, when either input is taken from (Vcc - 2 V) to all the way up to 36V, the PNP input stage devices, Q1 or Q4, as well as Q2 or Q3, Base-Emitter junctions are reverse biased and turn off. D2 and D3 block the reverse current to protect the current source transistors Q9 and Q11. This state cuts off the tail current (I1 and I2) and the output falls to a known state. The input bias current is in the sub nanoamp level as it is now just the reverse leakage currents of the transistor and diode junctions.
One of the "features" of the LM339 family is that the output remains correct as long as one input is still within the valid input voltage range. This is because the input device that is still within range still has tail current flowing to signal the following stages the proper output state. When both outputs are above the valid input range, all tail currents are cut off and the output defaults to a known state. For more information, please see section 2 of the application note "Application Design Guidelines for LM339, LM393, TL331 Family Comparators".