[m-rev.] diff: fix misleading mode error

Fergus Henderson fjh at cs.mu.OZ.AU
Thu Aug 2 23:18:47 AEST 2001


On 01-Aug-2001, Zoltan Somogyi <zs at cs.mu.OZ.AU> wrote:
> On 01-Aug-2001, Fergus Henderson <fjh at cs.mu.OZ.AU> wrote:
> > compiler/modecheck_unify.m:
> > 	Fix a couple of bugs where we were setting the call context before
> > 	mode-checking some sub-goal, and then forgetting to unset it
> > 	afterwards.  This resulted in the compiler issuing some misleading
> > 	error messages.
> 
> Is there a test case for this diff?

Unfortunately not.  I discovered the problem ages ago, while helping out
Levi, and mailed myself a patch to fix it.  Unfortunately I didn't take
the time then to isolate a simple test case.  I just spent a fair while
trying to reproduce the problem, without success; I did find some cases
for which the new compiler behaves slightly differently, but none that
actually exhibited the symptom of the problem.

However, from examination of the source code, I'm confident that the patch is
correct.  The old code had a bug, and even though I can't find any direct
way of exhibiting, it's better to fix it than to leave a latent bug in
the source waiting for someone to change the code in a way that exposes
the bug.

-- 
Fergus Henderson <fjh at cs.mu.oz.au>  |  "I have always known that the pursuit
The University of Melbourne         |  of excellence is a lethal habit"
WWW: <http://www.cs.mu.oz.au/~fjh>  |     -- the last words of T. S. Garp.
--------------------------------------------------------------------------
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