Re: Exception Handling

"Casse Hugues" <>
24 Jul 2002 02:28:41 -0400

          From comp.compilers

Related articles
Exception Handling (David Jobet) (2002-07-21)
Re: Exception Handling (VBDis) (2002-07-24)
Re: Exception Handling (Casse Hugues) (2002-07-24)
Re: Exception Handling (jacob navia) (2002-07-24)
Re: Exception Handling (David Jobet) (2002-07-25)
Re: Exception Handling (journeyman) (2002-08-04)
Re: Exception Handling (Nick Maclaren) (2002-08-10)
Re: Exception Handling (Marco van de Voort) (2002-08-10)
Re: Exception Handling (Maxim Reznik) (2002-08-10)
[6 later articles]
| List of all articles for this month |

From: "Casse Hugues" <>
Newsgroups: comp.compilers
Date: 24 Jul 2002 02:28:41 -0400
Organization: Guest of ProXad - France
References: 02-07-075
Keywords: errors
Posted-Date: 24 Jul 2002 02:28:41 EDT
X-Comment-To: "David Jobet" <>

I uses the POSIX C functions setjmp()/lonjmp() from <setjmp.h> for
emulating exceptions in my C programs. These functions stores the
registers in a memory and restore it when the jump is performed. This is
the faster way to implement it I know (in C).
    But you must think about memory management because these functions
handle only the register and do not know anything about memory. Usually,
fast exception handling requires either special memory structure, or
garbage collection.

    H. Cassť.

On Sun, 21 Jul 2002 08:06:29 +0200, David Jobet wrote:

> Hi,
> I'm developping a compiler (for the fun) for a new language called
> Nosica. (
> I'm stuck with exception implementation because I'm using C as as my
> assembly language.
> Finding docs for exceptions is not very easy, but I came to a model
> using custom setjmp /longjmp (because the standard C version appears to
> save a lot more than needed for C++ compatibility). ...
> Basically, I need to have the return address that the called function
> would return to if there was no exception thrown. In this case, the
> compiler could switch on this return value and produce the *good* code
> needed to clean up local variables.
> Problem is I don't know how to get this return address in order to
> produce the good case (here h_addr and f_addr).
> Is there any way to get them using assembly ?

Post a followup to this message

Return to the comp.compilers page.
Search the comp.compilers archives again.