gm2
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: [Gm2] cath exceptions raised in another module's init section


From: Martin Kalbfuß
Subject: RE: [Gm2] cath exceptions raised in another module's init section
Date: Thu, 07 Jan 2010 22:38:36 +0100

Searching the internet about this topic, I found the following rules for
the exception handling.

the EXCEPT section of the importing module isn't executed if the
imported module raises an exception.

But

if you have a local import inside a procedure, the EXCEPT section of the
importing procedure is executed.

Am Donnerstag, den 07.01.2010, 12:54 -0500 schrieb Breeden, Thomas
(tmb):
> > -----Original Message-----
> > From: Iztok Kobal [mailto:address@hidden
> > Sent: January 07, 2010 5:09 AM
> > To: Breeden, Thomas (tmb)
> > Cc: address@hidden
> > Subject: Re: [Gm2] cath exceptions raised in another module's init section
> > 
> > Breeden, Thomas (tmb) wrote:
> > > Remember that by definition the init sections of imported modules are
> > executed before the init section of the modules that import them (barring
> > circularities).
> > >
> > I agree and I would like to point out that what Thomas wrote is valid
> > when considering M2 perspective.
> > 
> > Yet, it is a slightly different considering the bytecode level
> > perspective since BEGIN (that means intro of init body)  of importing
> > module's init body executes before executing init bodies of imported
> > modules. So as a matter of fact, importing module would in fact have
> > already been executed when an exception appeared in the init section of
> > imported module.
> > 
> 
> Yes, I realize that is almost always the way a program will be started up at 
> the lower level.
> Now I am really wondering what the ISO specification calls for and also what 
> the defacto implementation is for M2 compilers.
> 
> Mainly I piped up because in fact the Amiga M2 compiler I've implemented does 
> not do the intro of
> the main program before executing the init sections of the imported modules. 
> (A pre-linker analyzes the program and
> generates an independent routine that calls all the module init sections in 
> the correct order and then the program.)
> 
> In spite of my argument that "importing" does not imply "starting", I'm 
> thinking I better change my compiler w/r/t the
> program EXCEPT catching.
> 
> I think it is clear though, that for the FINALLY section, if an uncleared 
> exception occurs in the init code of an imported module, the program module 
> FINALLY code should not be run.
> 
> Tom
> address@hidden
> 
> _______________________________________________
> gm2 mailing list
> address@hidden
> http://lists.nongnu.org/mailman/listinfo/gm2






reply via email to

[Prev in Thread] Current Thread [Next in Thread]