[DGD] error context frames versus stack frames

Raymond Jennings shentino at gmail.com
Thu Apr 13 20:34:17 CEST 2017


Just remember, function calls, catches, and rlimits can all nest separately.

Each function can itself have zero or more each of catch and rlimits
blocks nested pretty much arbitrarily.

catch {
   rlimits (50; 50000) {
      rlmits (20; 200) {
          catch(error("Foobar"));
          error("Baz");
      }
   }
}

Also, don't forget, that if you're in a catch handler (or anywhere
else for that matter) inside a tick limiting rlimits, and you are out
of ticks, you will immediately encounter a fresh "Out of ticks" error,
even in a catch handler.

On Thu, Apr 13, 2017 at 11:01 AM, Felix A. Croes <felix at dworkin.nl> wrote:
> Carter Cheng <cartercheng at gmail.com> wrote:
>
>> Is this basically used to locate the correct exception frame on the stack
>> corresponding to the function activation? In something like C++ one has to
>> unwind until one reaches a handler if it exists. I suspect in dgd's version
>> of lpc one has two unwind until one gets to the "function activation" that
>> originates the catch/rlimit blocks the resume execution after the
>> catch/rlimit
>
> Yes, there is an exception stack and a rlimits stack, both independent
> of the function stack.  When handling an exception DGD actually takes
> the exception stack as its lead, and unwinds function calls and rlimits
> contexts as needed.
>
> Regards,
> Felix Croes
> ____________________________________________
> https://mail.dworkin.nl/mailman/listinfo/dgd



More information about the DGD mailing list