[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: catching divide by zero
- From: Ross Bencina <rossb-lists@...>
- Date: Mon, 16 Dec 2013 11:40:21 +1100
On 16/12/2013 2:14 AM, Andy Colson wrote:
To make matters more complicated, my app is written in Delphi. But I
should be able to translate from C to Delphi pretty easy (if I could
understand how the C works).
divz exceptions are unmasked. Check the FPU control word.
I'm pretty sure that the standard Delphi environment is to unmask divz.
Certainly this was the case with Borland C++ Builder / VCL.
MSVC runtime definitely masks divz by default.
Further: loading and unloading DLLs can lead to a change in the FPU
control register if the runtime used by the DLL does something on
load/unload (I've seen this when showing a print dialog for example).
Your best bet is to re-mask divz at any time of risk.
Ross.