[m-dev.] for review: software errors from C code

Fergus Henderson fjh at cs.mu.OZ.AU
Thu Mar 26 18:17:07 AEDT 1998


On 26-Mar-1998, Andrew Bromage <bromage at cs.mu.OZ.AU> wrote:
> 	- a fix for a problem with the user-declared array_module
> 	  which conflicts with the compiler-declared array_module.
> 	  The fix is to call the user-declared one array_moduleX.

Hmm, array_moduleX is a somewhat ugly name.
How about `array_builtin_ops_module'?

> +void 
> +software_error(const char *message) {
> +	fflush(stdout);
> +	fprintf(stderr, "Software error: %s\n", message);
> +	MR_dump_stack(MR_succip, MR_sp);
> +	clean_up_after_fatal_error();
>  	exit(1);
>  }

There's no guarantee that `MR_succip' and `MR_sp' are valid here.
You need to do `restore_transient_registers()', with a
corresponding call to `save_transient_registers()' in the caller.

-- 
Fergus Henderson <fjh at cs.mu.oz.au>  |  "I have always known that the pursuit
WWW: <http://www.cs.mu.oz.au/~fjh>  |  of excellence is a lethal habit"
PGP: finger fjh at 128.250.37.3        |     -- the last words of T. S. Garp.



More information about the developers mailing list