[Top][All Lists]

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

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

From: Breeden, Thomas (tmb)
Subject: RE: [Gm2] cath exceptions raised in another module's init section
Date: Thu, 7 Jan 2010 12:54:16 -0500

> -----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.


reply via email to

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