[D-runtime] win32 regression in exception handling

Don Clugston dclugston at googlemail.com
Wed Jan 26 03:02:55 PST 2011


On 26 January 2011 11:17, Jonathan M Davis <jmdavisProg at gmx.com> wrote:
> On Wednesday 26 January 2011 01:58:50 Don Clugston wrote:
>> On 26 January 2011 10:32, Jonathan M Davis <jmdavisProg at gmx.com> wrote:
>> > How else would an error be thrown?
>>
>> In many cases, it's thrown by hardware. The exception object is
>> created long after the throw occurred.
>> There are also 'foreign' exceptions, which are thrown by (say) C++.
>>
>> (I suspect that Linux DMD can't handle any of those -- but Windows DMD
>> can).
>
> So, what exactly about that makes it a problem that the file and line number have
> default arguments? If it gives the arguments (like it pretty much has to be
> doing),

No, it doesn't give the arguments. It has no way of knowing what they
are (in fact, they may not even exist at all).

then it doesn't use the defaults, so they don't cause any problems
> there. And is it only file and line number which cause problems if they have
> defaults, or is it everything (e.g. Throwable next)?

It's only file and line number that are a problem. next will just be null.
The thing which you're maybe not understanding is that in these cases,
the exception object is created when it is caught, not when it is
thrown.


More information about the D-runtime mailing list