[m-rev.] diff: add a sanity check on stack size.

Tyson Dowd trd at cs.mu.OZ.AU
Wed Aug 22 20:56:55 AEST 2001


On 22-Aug-2001, Ralph Becket <rbeck at microsoft.com> wrote:
> > +	),
> > +		% This is a sanity check, the stack should never have a
> > +		% negative size.
> > +	( NewCurrent < 0 ->
> > +		error("stack underflow while calculating max stack")
> > +	;
> > +		true
> >  	).
> 
> The following is shorter and arguably clearer:
> 
>     require(NewCurrent >= 0, "stack underflow while calculating max
> stack")

Point taken, however I decided calling 
	unexpected(this_file, "stack underflow while calculating max stack")
would be even better.

Tyson.
--------------------------------------------------------------------------
mercury-reviews mailing list
post:  mercury-reviews at cs.mu.oz.au
administrative address: owner-mercury-reviews at cs.mu.oz.au
unsubscribe: Address: mercury-reviews-request at cs.mu.oz.au Message: unsubscribe
subscribe:   Address: mercury-reviews-request at cs.mu.oz.au Message: subscribe
--------------------------------------------------------------------------



More information about the reviews mailing list