Re: Source Code Question ?

new topic     » goto parent     » topic index » view thread      » older message » newer message

Bernie Ryan wrote:
> 
> Whoops !
> 
> In file be_machine.e :
> 
> This piece of code does not make sense it is always going to be included ?
> 
> I also think it should have a simple user message like:
> 
> " Your program is using an illegal poke or peek in a reserved
> memory location ! "
> 
> because the average user does not know what a machine-level exception is.
>   
> -------------------------------
> 
> #ifdef ERUNTIME
> void Machine_Handler(int sig_no)
> /* illegal instruction, segmentation violation */
> {
>     RTFatal("A machine-level exception occurred during execution of your
>     program");
> }
> #else
> void Machine_Handler(int sig_no)
> /* illegal instruction, segmentation violation */
> {
>     RTFatal("A machine-level exception occurred during execution of this
>     statement");
> }
> #endif

When ERUNTIME is defined, it means that the backend library for translating
is being built.  In the translator, all sorts of crazy stuff can cause a
machine-level exception that would normally be caught by the interpreter,
like an index out of bounds.

The translator doesn't do this sort of checking.  You're assumed to have 
thoroughly debugged your program before you translate.  And there's no
way to tell which statement has caused this error.  In the interpreter,
however, we can tell which statement was last executed, so the message
is a bit different.

Matt

new topic     » goto parent     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu