Dwarf Exception Handling question

Walter Bright via Digitalmars-d digitalmars-d at puremagic.com
Mon Nov 23 17:15:03 PST 2015


On 11/23/2015 4:36 PM, David Nadlinger wrote:
> On Monday, 23 November 2015 at 21:05:29 UTC, Walter Bright wrote:
>> The code looks quite good. I've been trying to adjust things, however, so
>> there are no pushes and pops in the code, trying to preallocate everything
>> needed in the function prolog.
>
> Wouldn't you still need to restore the stack before leaving the function (tail
> call in this case)?

Yes.


>> dmd rewrites try-catch-finally into try-{try-catch}-finally, which makes it
>> easier to generate code, because fewer special cases and fewer bugs. I've
>> become a big fan of that technique
>
> Except that we actually need to flatten all the nesting into a single landing
> pad anyway.

I don't know why that would be true. gdc generates multiple landing pads.


> How would you do this in DMD? I didn't realize you could even have
> multiple EH table entries attached to a single code location.

You can't. The most deeply nested one gets the table entry.



More information about the Digitalmars-d mailing list